Changeset 4f4a8a4 for python/bench-pitch
- Timestamp:
- Dec 19, 2005, 10:25:51 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:
- f2adb86
- Parents:
- 7c9ad74
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/bench-pitch
r7c9ad74 r4f4a8a4 6 6 class benchpitch(bench): 7 7 8 def compute_file(self,input,output):8 def file_exec(self,input,output): 9 9 filetask = self.task(input,params=self.params) 10 10 computed_data = filetask.compute_all() … … 13 13 truth = filetask.gettruth() 14 14 #print input, results, results - float(input.split('.')[-2]) 15 self.pretty_print((self.params. mode, truth,15 self.pretty_print((self.params.pitchmode, truth, 16 16 truth - results[0], results[0], 17 17 truth - results[1], results[1])) 18 18 19 def compute_data(self): 20 self.orig, self.missed, self.merged, self.expc, \ 21 self.bad, self.doubled = 0, 0, 0, 0, 0, 0 22 act_on_data(self.compute_file,self.datadir, \ 23 suffix='',filter='f -name \'*.wav\'') 24 25 def compute_results(self,truth): 26 for i in self.results: print i 27 28 def run_bench(self,modes=['dual']): 19 def run_bench(self,modes=['schmitt']): 29 20 self.modes = modes 30 21 self.pretty_print(self.titles) 31 22 for mode in self.modes: 32 self.params. mode = mode33 self. compute_data()34 #self.compute_results()35 #self.pretty_print(self.results)23 self.params.pitchmode = mode 24 self.dir_exec() 25 self.dir_eval() 26 self.dir_plot() 36 27 37 28 if __name__ == "__main__": … … 39 30 if len(sys.argv) > 1: datapath = sys.argv[1] 40 31 else: print "error: a path is required"; sys.exit(1) 41 42 modes = ['schmitt', 'yin', 'mcomb', 'fcomb'] 32 if len(sys.argv) > 2: 33 for each in sys.argv[3:-1]: print each 34 modes = ['yin', 'schmitt', 'mcomb', 'fcomb'] 43 35 44 36 benchpitch = benchpitch(datapath) 45 37 benchpitch.params = taskparams() 46 38 benchpitch.task = taskpitch 39 47 40 48 41 benchpitch.titles = [ 'mode', 'thres', 'avg', 'avgdist' ]
Note: See TracChangeset
for help on using the changeset viewer.