Changeset c912c67 for python/aubio/bench/node.py
- Timestamp:
- Feb 17, 2006, 6:17:10 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:
- d998190
- Parents:
- e968939
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/aubio/bench/node.py
re968939 rc912c67 144 144 act_on_results(mkdir,self.datadir,self.resdir,filter='d') 145 145 146 def pretty_print(self,values,sep='|'): 147 for i in range(len(values)): 148 print self.formats[i] % values[i], sep, 146 def pretty_print(self,sep='|'): 147 for i in self.printnames: 148 print self.formats[i] % self.v[i], sep, 149 print 150 151 def pretty_titles(self,sep='|'): 152 for i in self.printnames: 153 print self.formats[i] % i, sep, 149 154 print 150 155 151 156 def dir_exec(self): 152 157 """ run file_exec on every input file """ 153 pass 158 self.l , self.labs = [], [] 159 self.v = {} 160 for i in self.valuenames: 161 self.v[i] = [] 162 for i in self.valuelists: 163 self.v[i] = [] 164 act_on_files(self.file_exec,self.sndlist,self.reslist, \ 165 suffix='',filter=sndfile_filter) 154 166 155 167 def dir_eval(self): 156 168 pass 157 169 158 def file_exec(self): 159 pass 170 def file_gettruth(self,input): 171 """ get ground truth filenames """ 172 from os.path import isfile 173 ftrulist = [] 174 # search for match as filetask.input,".txt" 175 ftru = '.'.join(input.split('.')[:-1]) 176 ftru = '.'.join((ftru,'txt')) 177 if isfile(ftru): 178 ftrulist.append(ftru) 179 else: 180 # search for matches for filetask.input in the list of results 181 for i in range(len(self.reslist)): 182 check = '.'.join(self.reslist[i].split('.')[:-1]) 183 check = '_'.join(check.split('_')[:-1]) 184 if check == '.'.join(input.split('.')[:-1]): 185 ftrulist.append(self.reslist[i]) 186 return ftrulist 187 188 def file_exec(self,input,output): 189 """ create filetask, extract data, evaluate """ 190 filetask = self.task(input,params=self.params) 191 computed_data = filetask.compute_all() 192 ftrulist = self.file_gettruth(filetask.input) 193 for i in ftrulist: 194 filetask.eval(computed_data,i,mode='rocloc',vmode='') 195 """ append filetask.v to self.v """ 196 for i in self.valuenames: 197 self.v[i].append(filetask.v[i]) 198 for j in self.valuelists: 199 if filetask.v[j]: 200 for i in range(len(filetask.v[j])): 201 self.v[j].append(filetask.v[j][i]) 160 202 161 203 def file_eval(self):
Note: See TracChangeset
for help on using the changeset viewer.