Changeset 4f4a8a4 for python/bench-pitch


Ignore:
Timestamp:
Dec 19, 2005, 10:25:51 PM (19 years ago)
Author:
Paul Brossier <piem@altern.org>
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
Message:

move to new nodes and tasks
move to new nodes and tasks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/bench-pitch

    r7c9ad74 r4f4a8a4  
    66class benchpitch(bench):
    77       
    8         def compute_file(self,input,output):
     8        def file_exec(self,input,output):
    99                filetask = self.task(input,params=self.params)
    1010                computed_data = filetask.compute_all()
     
    1313                truth = filetask.gettruth()
    1414                #print input, results, results - float(input.split('.')[-2])
    15                 self.pretty_print((self.params.mode, truth,
     15                self.pretty_print((self.params.pitchmode, truth,
    1616                        truth - results[0], results[0],
    1717                        truth - results[1], results[1]))
    1818                       
    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']):
    2920                self.modes = modes
    3021                self.pretty_print(self.titles)
    3122                for mode in self.modes:
    32                         self.params.mode = mode
    33                         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()
    3627
    3728if __name__ == "__main__":
     
    3930        if len(sys.argv) > 1: datapath = sys.argv[1]
    4031        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']
    4335
    4436        benchpitch = benchpitch(datapath)
    4537        benchpitch.params = taskparams()
    4638        benchpitch.task = taskpitch
     39
    4740
    4841        benchpitch.titles  = [ 'mode', 'thres', 'avg', 'avgdist' ]
Note: See TracChangeset for help on using the changeset viewer.