changeset 873:6b474db46b45

added csv printing option
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Wed, 15 Feb 2017 14:54:10 -0500
parents c70adaeeddf5
children a1e92c48dfb4
files scripts/compute-clearmot.py
diffstat 1 files changed, 9 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/compute-clearmot.py	Wed Feb 08 16:32:15 2017 -0500
+++ b/scripts/compute-clearmot.py	Wed Feb 15 14:54:10 2017 -0500
@@ -29,6 +29,7 @@
 parser.add_argument('--undistorted-multiplication', dest = 'undistortedImageMultiplication', help = 'undistorted image multiplication', type = float)
 
 parser.add_argument('-i', dest = 'videoFilename', help = 'name of the video file (for display)')
+parser.add_argument('--csv', dest = 'csvOutput', help = 'output comma-separated metrics')
 args = parser.parse_args()
 
 if args.homographyFilename is not None:
@@ -61,12 +62,14 @@
 else:
     motp, mota, mt, mme, fpt, gt = moving.computeClearMOT(annotations, objects, args.matchingDistance, args.firstInstant, args.lastInstant)
 
-
-print 'MOTP: {}'.format(motp)
-print 'MOTA: {}'.format(mota)
-print 'Number of missed objects.frames: {}'.format(mt)
-print 'Number of mismatches: {}'.format(mme)
-print 'Number of false alarms.frames: {}'.format(fpt)
+if args.csvOutput:
+    print(','.join([motp, mota, mt, mme, fpt]))
+else:
+    print 'MOTP: {}'.format(motp)
+    print 'MOTA: {}'.format(mota)
+    print 'Number of missed objects.frames: {}'.format(mt)
+    print 'Number of mismatches: {}'.format(mme)
+    print 'Number of false alarms.frames: {}'.format(fpt)
 
 def shiftMatches(matches, offset):
     shifted = {}