diff scripts/compute-clearmot.py @ 723:e14e2101a5a9

returns detailed matching information for clear mot
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Thu, 06 Aug 2015 17:47:04 -0400
parents 3058e00887bc
children 43ae3a1af290
line wrap: on
line diff
--- a/scripts/compute-clearmot.py	Wed Aug 05 00:12:52 2015 -0400
+++ b/scripts/compute-clearmot.py	Thu Aug 06 17:47:04 2015 -0400
@@ -18,6 +18,7 @@
 parser.add_argument('-m', dest = 'matchingDistance', help = 'matching distance between tracker and ground truth trajectories', required = True, type = float)
 parser.add_argument('-f', dest = 'firstInstant', help = 'first instant for measurement', required = True, type = int)
 parser.add_argument('-l', dest = 'lastInstant', help = 'last instant for measurement', required = True, type = int)
+parser.add_argument('--display', dest = 'display', help = 'display the ground truth to object matches (graphically)', action = 'store_true')
 args = parser.parse_args()
 
 if args.homographyFilename is not None:
@@ -30,10 +31,19 @@
 for a in annotations:
     a.computeCentroidTrajectory(homography)
 
-motp, mota, mt, mme, fpt, gt = moving.computeClearMOT(annotations, objects, args.matchingDistance, args.firstInstant, args.lastInstant)
+if args.display:
+    motp, mota, mt, mme, fpt, gt, gtMatches, toMatches = moving.computeClearMOT(annotations, objects, args.matchingDistance, args.firstInstant, args.lastInstant, True)
+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.display:
+    print('Ground truth matches')
+    print(gtMatches)
+    print('Object matches')
+    print toMatches