Changeset a9d9c5c for python/aubiocompare-onset
- Timestamp:
- May 28, 2005, 8:45:34 AM (20 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:
- ead2920
- Parents:
- 5a1ff62
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/aubiocompare-onset
r5a1ff62 ra9d9c5c 55 55 56 56 import sys 57 from aubio.onsetcompare import onset_roc 57 from aubio.onsetcompare import onset_roc, onset_diffs 58 58 from aubio.txtfile import read_datafile 59 59 … … 63 63 #tol = 0.050 64 64 tol = 0.048 65 # default mode is onset 66 mode = 'onset' 65 67 66 68 while len(sys.argv) >=2: … … 73 75 if option == '-D': delay = float(sys.argv[1]); del sys.argv[1] 74 76 if option == '-tol': tol = float(sys.argv[1]); del sys.argv[1] 77 if option == '-l': mode = 'localisation' 75 78 76 79 # arguments required … … 87 90 lres[i] = lres[i] + delay 88 91 # compute errors types 89 orig, missed, merged, expc, bad, doubled = \ 90 onset_roc(ltru,lres,tol) 91 92 # print results 93 #print "orig, missed, merged, expc, bad, doubled:" 94 if vmode=='verbose': 95 print "GD %2.8f\t" % (100*float(orig-missed-merged)/(orig)), 96 print "FP %2.8f\t" % (100*float(bad+doubled)/(orig)) , 97 print "GD-merged %2.8f\t" % (100*float(orig-missed)/(orig)) , 98 print "FP-pruned %2.8f\t" % (100*float(bad)/(orig)) 92 if mode == 'localisation': 93 l = onset_diffs(ltru,lres,tol) 94 for i in l: print i 99 95 else: 100 print orig, missed, merged, expc, bad, doubled 96 orig, missed, merged, expc, bad, doubled = onset_roc(ltru,lres,tol) 97 98 # print results 99 #print "orig, missed, merged, expc, bad, doubled:" 100 if vmode=='verbose': 101 print "GD %2.8f\t" % (100*float(orig-missed-merged)/(orig)), 102 print "FP %2.8f\t" % (100*float(bad+doubled)/(orig)) , 103 print "GD-merged %2.8f\t" % (100*float(orig-missed)/(orig)) , 104 print "FP-pruned %2.8f\t" % (100*float(bad)/(orig)) 105 else: 106 print orig, missed, merged, expc, bad, doubled
Note: See TracChangeset
for help on using the changeset viewer.