diff scripts/compute-clearmot.py @ 592:985a3021cff2

first match table implementation
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Fri, 05 Dec 2014 17:50:16 -0500
parents aded6c1c2ebd
children e2a873e08568
line wrap: on
line diff
--- a/scripts/compute-clearmot.py	Fri Dec 05 17:00:37 2014 -0500
+++ b/scripts/compute-clearmot.py	Fri Dec 05 17:50:16 2014 -0500
@@ -1,10 +1,11 @@
 #! /usr/bin/env python
 
 import sys, argparse
-
+from numpy import loadtxt
 import moving, storage
 
-from numpy import loadtxt
+# TODO: need to trim objects to same mask ?
+# pass frame interval where matching is done?
 
 parser = argparse.ArgumentParser(description='The program computes the CLEAR MOT metrics between ground truth and tracker output (in Polytrack format)', epilog='''CLEAR MOT metrics information:
 Keni, Bernardin, and Stiefelhagen Rainer. "Evaluating multiple object tracking performance: the CLEAR MOT metrics." EURASIP Journal on Image and Video Processing 2008 (2008)
@@ -16,6 +17,8 @@
 parser.add_argument('-g', dest = 'groundTruthDatabaseFilename', help = 'name of the Sqlite database containing the ground truth', required = True)
 parser.add_argument('-o', dest = 'homographyFilename', help = 'name of the filename for the homography (if tracking was done using the homography)')
 parser.add_argument('-m', dest = 'matchingDistance', help = 'matching distance between tracker and ground truth trajectories', required = True)
+parser.add_argument('-f', dest = 'firstInstant', help = 'first instant for measurement', required = True)
+parser.add_argument('-l', dest = 'lastInstant', help = 'last instant for measurement', required = True)
 args = parser.parse_args()
 
 # args.homographyFilename is None if nothing as argument
@@ -29,5 +32,7 @@
 for a in annotations:
     a.computeCentroidTrajectory(homography)
 
-moving.matchingGroundTruthToTracker(objects, annotations, args.matchingDistance)
+moving.matchingGroundTruthToTracker(objects, annotations, args.matchingDistance, 
+                                    int(args.firstInstant), int(args.lastInstant))
 #storage.deleteFromSqlite(args.databaseFilename, args.dataType)
+