Changeset 336cf77


Ignore:
Timestamp:
Dec 16, 2005, 5:34:00 AM (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:
50791b3
Parents:
75139a9
Message:

rename class task to bench, move pretty_print into it
rename class task to bench, move pretty_print into it

Location:
python
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/aubio/bench/node.py

    r75139a9 r336cf77  
    7171                action("%s%s%s"%(respath,'/',s))
    7272
    73 class task:
     73class bench:
    7474
    75         def __init__(self,datadir,resdir):
     75        def __init__(self,datadir,resdir,checkres=False,checkanno=False):
    7676                self.datadir = datadir
    7777                self.resdir = resdir
    7878                print "Checking data directory", self.datadir
    7979                self.checkdata()
    80                 self.checkres()
     80                if checkanno: self.checkanno()
     81                if checkres: self.checkres()
    8182       
    8283        def checkdata(self):
     
    8990                print " (%d elements)" % len(self.sndlist)
    9091                #for each in self.sndlist: print each
     92       
     93        def checkanno(self):
    9194                print "Listing annotations in data directory",
    9295                self.reslist = list_res_files(self.datadir)
     
    102105                print "Creating results directory"
    103106                act_on_results(mkdir,self.datadir,self.resdir,filter='d')
     107
     108        def pretty_print(self,values):
     109                for i in range(len(values)):
     110                        print self.formats[i] % values[i],
     111                print
     112
  • python/bench-onset

    r75139a9 r336cf77  
    1818                self.mode = 'dual'
    1919
    20 class taskonset(task):
     20class benchonset(bench):
    2121       
    22         def pretty_print(self,values):
    23                 for i in range(len(values)):
    24                         print self.formats[i] % values[i],
    25                 print
    26 
    2722        def compute_results(self):
    2823                self.P = 100*float(self.expc-self.missed-self.merged)/(self.expc-self.missed-self.merged + self.bad+self.doubled)
     
    158153respath = '/var/tmp/DB-testings'
    159154
    160 taskonset = taskonset(datapath,respath)
     155benchonset = benchonset(datapath,respath,checkres=True,checkanno=True)
    161156
    162 taskonset.params = onset_parameters()
     157benchonset.params = onset_parameters()
    163158
    164 taskonset.titles = [ 'mode', 'thres', 'orig', 'expc', 'missd', 'mergd',
     159benchonset.titles = [ 'mode', 'thres', 'orig', 'expc', 'missd', 'mergd',
    165160'bad', 'doubl', 'corrt', 'GD', 'FP', 'GD-merged', 'FP-pruned',
    166161'prec', 'recl', 'dist' ]
    167 taskonset.formats = ["%12s" , "| %6s", "| %6s", "| %6s", "| %6s", "| %6s",
     162benchonset.formats = ["%12s" , "| %6s", "| %6s", "| %6s", "| %6s", "| %6s",
    168163"| %6s", "| %6s", "| %6s", "| %8s", "| %8s", "| %8s", "| %8s",
    169164"| %6s", "| %6s", "| %6s"]
    170165
    171 #taskonset.run_bench(modes=modes,thresholds=thresholds)
    172 taskonset.auto_learn(modes=modes)
     166#benchonset.run_bench(modes=modes,thresholds=thresholds)
     167benchonset.auto_learn(modes=modes)
    173168
    174169#        gatherdata
Note: See TracChangeset for help on using the changeset viewer.