Changeset 807f029


Ignore:
Timestamp:
Mar 21, 2006, 11:35:27 PM (18 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:
9abd0f3
Parents:
6610143
Message:

update bench-pitch
update bench-pitch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/test/bench/pitch/bench-pitch

    r6610143 r807f029  
    1010        """ list of lists to store per file """
    1111        valuelists = ['truth', 'osil', 'esil', 'opit', 'epit', 'echr',
    12                'Msil', 'Mpit', 'Mchr']
     12               'Msil', 'Mpit', 'Mchr',
     13               'TotalPit', 'TotalPit', 'TotalChr' ]
    1314        """ list of values to print per dir """
    14         printnames = [ 'mode', 'truth', 'Msil', 'Mpit', 'Mchr']
     15        printnames = [ 'mode', 'MinPit', 'MaxPit', 'TotalSil', 'TotalPit', 'TotalChr']
    1516
    1617        """ per dir """
     
    1920                'osil': "%s", 'esil': "%s",
    2021                'opit': "%s", 'epit': "%s", 'echr': "%s",
     22                'TotalPit': "%s", 'TotalSil': "%s", 'TotalChr': "%s",
     23                'MinPit': "%s", 'MaxPit': "%s",
    2124                'Msil': "%s", 'Mpit': "%s", 'Mchr': "%s"}
    2225
     
    2932                filetask = self.task(input,params=self.params)
    3033                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)
    3235                self.v['truth'].append(int(filetask.truth))
    3336                assert opit > 0
     
    5255                for mode in self.modes:
    5356                        self.params.pitchmode = mode
    54                         self.dir_eval_print()
     57                        self.dir_exec()
     58                        self.dir_eval()
    5559                        truth   = [i for i in range(min(self.v['truth']),max(self.v['truth'])+1)]
    5660                        allOsil = [0 for i in range(min(self.v['truth']),max(self.v['truth'])+1)]
     
    6973                                allEchr[self.v['truth'][i]-min(self.v['truth'])] += self.v['echr'][i]
    7074                        for i in range(len(truth)):
     75                                allOsil[i] = max(1,allOsil[i])
     76                                allOpit[i] = max(1,allOpit[i])
    7177                                allMsil[i] = allEsil[i]/float(allOsil[i])*100.
    7278                                allMpit[i] = allEpit[i]/float(allOpit[i])*100.
    7379                                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()
    7486
    7587                        plot = []
     
    156168        if len(sys.argv) > 2:
    157169                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']
    160171
    161172        params = taskparams()
    162         params.bufsize = 2048
    163         params.hopsize = params.bufsize/8
    164         params.silence = -60.
     173        params.bufsize = 2048 #4096
     174        params.hopsize = 256
     175        params.silence = -70.
    165176        params.pitchsmooth = 0
    166177        params.pitchmax = 20000
    167178        params.pitchmin = 20
     179        params.pitchyinfft = 0.95
    168180        benchpitch = benchpitch(datapath,params=params)
    169181        benchpitch.task = taskpitch
Note: See TracChangeset for help on using the changeset viewer.