Merge aubio.org:/git/aubio/aubio
[aubio.git] / python / aubiocompare-onset
index e5fcf55be7a382d2442e45261bedf23d1a3112a2..39fc2764c30913e41945de7ad7b2710dd514738f 100755 (executable)
@@ -7,21 +7,22 @@ print aubio.__LICENSE__ for the terms of use
 or see LICENSE.txt in the aubio installation directory.
 """
 __LICENSE__ = """\
-        Copyright (C) 2004 Paul Brossier <piem@altern.org>
+  Copyright (C) 2004-2009 Paul Brossier <piem@aubio.org>
 
-        This program is free software; you can redistribute it and/or modify
-        it under the terms of the GNU General Public License as published by
-        the Free Software Foundation; either version 2 of the License, or
-        (at your option) any later version.
+  This file is part of aubio.
 
-        This program is distributed in the hope that it will be useful,
-        but WITHOUT ANY WARRANTY; without even the implied warranty of
-        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-        GNU General Public License for more details.
+  aubio is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation, either version 3 of the License, or
+  (at your option) any later version.
 
-        You should have received a copy of the GNU General Public License
-        along with this program; if not, write to the Free Software
-        Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  aubio is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with aubio.  If not, see <http://www.gnu.org/licenses/>.
 """            
 
 
@@ -91,13 +92,20 @@ if delay:
 # compute errors types
 if mode == 'localisation':
        l = onset_diffs(ltru,lres,tol)
-       for i in l: print i
+       for i in l: print "%.3f" % i
 else:
        orig, missed, merged, expc, bad, doubled = onset_roc(ltru,lres,tol)
        
        # print results
        #print "orig, missed, merged, expc, bad, doubled:"
        if vmode=='verbose':
+           print "orig", orig
+            print "expc", expc
+            print "missed",missed
+            print "merged", merged
+            print "bad", bad
+            print "doubled", doubled
+            print "correct", orig-missed-merged
            print "GD %2.8f\t"        % (100*float(orig-missed-merged)/(orig)),
            print "FP %2.8f\t"        % (100*float(bad+doubled)/(orig))       , 
            print "GD-merged %2.8f\t" % (100*float(orig-missed)/(orig))       ,