Changeset 7445aea
- Timestamp:
- Mar 29, 2005, 5:46:05 PM (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:
- 19b56b0
- Parents:
- 20f9748
- Location:
- python
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/aubio/onsetcompare.py
r20f9748 r7445aea 54 54 ok = n - missed 55 55 hits = m - bad 56 # at this point, we must have ok = hits. if not we had 57 # - a case were one onset counted for two labels (ok>hits) 58 # - a case were one labels matched two onsets (hits>ok) 59 # bad hack for now (fails if both above cases have happened): 60 if ok > hits: bad += ok-hits; ok = hits 61 if hits > ok: missed += hits-ok; hits = ok 56 62 total = n 57 63 return ok,bad,missed,total,hits -
python/aubiocompare-onset
r20f9748 r7445aea 61 61 fileo=None;filec=None;vmode=None;dmode=None;delay=0. 62 62 # default tolerance is 50 ms 63 tol = 0.050 63 #tol = 0.050 64 tol = 0.048 64 65 65 66 while len(sys.argv) >=2: … … 71 72 if option == '-d': dmode = 'debug' 72 73 if option == '-D': delay = float(sys.argv[1]); del sys.argv[1] 74 if option == '-tol': tol = float(sys.argv[1]); del sys.argv[1] 73 75 74 76 # arguments required … … 81 83 82 84 # delay onsets as required with -D 83 for i in range(len(lres)): 84 lres[i] = lres[i] + delay 85 if delay: 86 for i in range(len(lres)): 87 lres[i] = lres[i] + delay 85 88 # compute errors types 86 89 ok, bad, missed, total, hits = onset_roc(ltru,lres,tol)
Note: See TracChangeset
for help on using the changeset viewer.