Ignore:
Timestamp:
May 28, 2005, 8:45:34 AM (20 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:
ead2920
Parents:
5a1ff62
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/aubiocompare-onset

    r5a1ff62 ra9d9c5c  
    5555
    5656import sys
    57 from aubio.onsetcompare import onset_roc
     57from aubio.onsetcompare import onset_roc, onset_diffs
    5858from aubio.txtfile import read_datafile
    5959
     
    6363#tol = 0.050
    6464tol = 0.048
     65# default mode is onset
     66mode = 'onset'
    6567
    6668while len(sys.argv) >=2:
     
    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
     
    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))               
     92if mode == 'localisation':
     93        l = onset_diffs(ltru,lres,tol)
     94        for i in l: print i
    9995else:
    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.