Changeset 1dae4eb for python/aubio
- Timestamp:
- Dec 22, 2005, 5:50:37 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:
- c32976a5
- Parents:
- af445db
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/aubio/bench/node.py
raf445db r1dae4eb 78 78 action("%s%s%s"%(respath,'/',s)) 79 79 80 def act_on_files (action,listfiles,listres=None,suffix='.txt',filter='f',sub='\.wav$',**keywords): 81 """ execute action(respath) an all subdirectories in respath """ 82 if listres and len(listfiles) <= len(listres): 83 for i in listfiles: 84 action(i,listres[i],**keywords) 85 else: 86 for i in listfiles: 87 action(i,None,**keywords) 88 80 89 class bench: 81 90 """ class to run benchmarks on directories """ 82 91 def __init__(self,datadir,resdir=None,checkres=False,checkanno=False): 83 92 self.datadir = datadir 93 # path to write results path to 84 94 self.resdir = resdir 95 # list of annotation files 96 self.reslist = [] 97 # list used to gather results 85 98 self.results = [] 86 99 print "Checking data directory", self.datadir … … 90 103 91 104 def checkdata(self): 105 if os.path.isfile(self.datadir): 106 self.dirlist = os.path.dirname(self.datadir) 107 print "DBG: found a file" 108 elif os.path.isdir(self.datadir): 109 self.dirlist = list_dirs(self.datadir) 110 print "DBG: found a dir" 111 # allow dir* matching through find commands? 112 else: 113 print "ERR: path not understood" 114 sys.exit(1) 92 115 print "Listing directories in data directory", 93 self.dirlist = list_dirs(self.datadir)94 116 if self.dirlist: 95 117 print " (%d elements)" % len(self.dirlist) … … 106 128 print "ERR: no sound files were found in", self.datadir 107 129 sys.exit(1) 108 #for each in self.sndlist: print each109 130 110 131 def checkanno(self): … … 132 153 self.orig, self.missed, self.merged, self.expc, \ 133 154 self.bad, self.doubled = 0, 0, 0, 0, 0, 0 134 act_on_ data(self.file_exec,self.datadir,self.resdir, \155 act_on_files(self.file_exec,self.sndlist,self.reslist, \ 135 156 suffix='',filter=sndfile_filter) 136 157
Note: See TracChangeset
for help on using the changeset viewer.