History

updated to new onset_roc, added -l for onset_diffs updated to new onset_roc, added -l for onset_diffs

Paul Brossier committed 21 years ago

Commit a9d9c5c1 parent 5a1ff621 file · +18 −12Browse files

Showing the changes to python (1 of 1 file). Show all

Unified · Split

python/aubiocompare-onset+18−12
@@ -54,7 +54,7 @@ does not scale to very long lists · 53 unmodified lines
5454 """
5555
5656 import sys
57−from aubio.onsetcompare import onset_roc
57+from aubio.onsetcompare import onset_roc, onset_diffs
5858 from aubio.txtfile import read_datafile
5959
6060 # default values
@@ -62,6 +62,8 @@ fileo=None;filec=None;vmode=None;dmode=None;delay=0. · 1 unmodified line
6262 # default tolerance is 50 ms
6363 #tol = 0.050
6464 tol = 0.048
65+# default mode is onset
66+mode = 'onset'
6567
6668 while len(sys.argv) >=2:
6769 option = sys.argv[1]; del sys.argv[1]
@@ -72,6 +74,7 @@ while len(sys.argv) >=2: · 4 unmodified lines
7274 if option == '-d': dmode = 'debug'
7375 if option == '-D': delay = float(sys.argv[1]); del sys.argv[1]
7476 if option == '-tol': tol = float(sys.argv[1]); del sys.argv[1]
77+ if option == '-l': mode = 'localisation'
7578
7679 # arguments required
7780 if (not fileo) or (not filec):
@@ -86,15 +89,18 @@ if delay: · 8 unmodified lines
8689 for i in range(len(lres)):
8790 lres[i] = lres[i] + delay
8891 # 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
9995 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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t