- Timestamp:
- Mar 21, 2006, 11:35:27 PM (19 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- 9abd0f3
- Parents:
- 6610143
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/test/bench/pitch/bench-pitch
r6610143 r807f029 10 10 """ list of lists to store per file """ 11 11 valuelists = ['truth', 'osil', 'esil', 'opit', 'epit', 'echr', 12 'Msil', 'Mpit', 'Mchr'] 12 'Msil', 'Mpit', 'Mchr', 13 'TotalPit', 'TotalPit', 'TotalChr' ] 13 14 """ list of values to print per dir """ 14 printnames = [ 'mode', ' truth', 'Msil', 'Mpit', 'Mchr']15 printnames = [ 'mode', 'MinPit', 'MaxPit', 'TotalSil', 'TotalPit', 'TotalChr'] 15 16 16 17 """ per dir """ … … 19 20 'osil': "%s", 'esil': "%s", 20 21 'opit': "%s", 'epit': "%s", 'echr': "%s", 22 'TotalPit': "%s", 'TotalSil': "%s", 'TotalChr': "%s", 23 'MinPit': "%s", 'MaxPit': "%s", 21 24 'Msil': "%s", 'Mpit': "%s", 'Mchr': "%s"} 22 25 … … 29 32 filetask = self.task(input,params=self.params) 30 33 computed_data = filetask.compute_all() 31 osil, esil, opit, epit, echr = filetask.eval(computed_data )34 osil, esil, opit, epit, echr = filetask.eval(computed_data,tol=0.5) 32 35 self.v['truth'].append(int(filetask.truth)) 33 36 assert opit > 0 … … 52 55 for mode in self.modes: 53 56 self.params.pitchmode = mode 54 self.dir_eval_print() 57 self.dir_exec() 58 self.dir_eval() 55 59 truth = [i for i in range(min(self.v['truth']),max(self.v['truth'])+1)] 56 60 allOsil = [0 for i in range(min(self.v['truth']),max(self.v['truth'])+1)] … … 69 73 allEchr[self.v['truth'][i]-min(self.v['truth'])] += self.v['echr'][i] 70 74 for i in range(len(truth)): 75 allOsil[i] = max(1,allOsil[i]) 76 allOpit[i] = max(1,allOpit[i]) 71 77 allMsil[i] = allEsil[i]/float(allOsil[i])*100. 72 78 allMpit[i] = allEpit[i]/float(allOpit[i])*100. 73 79 allMchr[i] = allEchr[i]/float(allOpit[i])*100. 80 self.v['TotalSil'] = sum(allMsil)/len(truth) 81 self.v['TotalPit'] = sum(allMpit)/len(truth) 82 self.v['TotalChr'] = sum(allMchr)/len(truth) 83 self.v['MinPit'] = min(truth) 84 self.v['MaxPit'] = max(truth) 85 self.pretty_print() 74 86 75 87 plot = [] … … 156 168 if len(sys.argv) > 2: 157 169 for each in sys.argv[3:-1]: print each 158 modes = ['schmitt', 'yin', 'mcomb', 'fcomb'] 159 modes = ['schmitt', 'yin', 'fcomb'] 170 modes = ['schmitt', 'yin', 'yinfft', 'mcomb', 'fcomb'] 160 171 161 172 params = taskparams() 162 params.bufsize = 2048 163 params.hopsize = params.bufsize/8164 params.silence = - 60.173 params.bufsize = 2048 #4096 174 params.hopsize = 256 175 params.silence = -70. 165 176 params.pitchsmooth = 0 166 177 params.pitchmax = 20000 167 178 params.pitchmin = 20 179 params.pitchyinfft = 0.95 168 180 benchpitch = benchpitch(datapath,params=params) 169 181 benchpitch.task = taskpitch
Note: See TracChangeset
for help on using the changeset viewer.