Mercurial Hosting > traffic-intelligence
comparison scripts/compute-clearmot.py @ 593:e2a873e08568
non-working clear mot metrics
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Sat, 06 Dec 2014 22:15:56 -0500 |
parents | 985a3021cff2 |
children | 9e39cd95e017 |
comparison
equal
deleted
inserted
replaced
592:985a3021cff2 | 593:e2a873e08568 |
---|---|
25 if args.homographyFilename != None: | 25 if args.homographyFilename != None: |
26 homography = loadtxt(args.homographyFilename) | 26 homography = loadtxt(args.homographyFilename) |
27 else: | 27 else: |
28 homography = None | 28 homography = None |
29 | 29 |
30 firstInstant = int(args.firstInstant) | |
31 lastInstant = int(args.lastInstant) | |
32 | |
30 objects = storage.loadTrajectoriesFromSqlite(args.trackerDatabaseFilename, 'object') | 33 objects = storage.loadTrajectoriesFromSqlite(args.trackerDatabaseFilename, 'object') |
31 annotations = storage.loadGroundTruthFromSqlite(args.groundTruthDatabaseFilename) | 34 annotations = storage.loadGroundTruthFromSqlite(args.groundTruthDatabaseFilename) |
32 for a in annotations: | 35 for a in annotations: |
33 a.computeCentroidTrajectory(homography) | 36 a.computeCentroidTrajectory(homography) |
34 | 37 |
35 moving.matchingGroundTruthToTracker(objects, annotations, args.matchingDistance, | 38 matchTable = moving.matchingGroundTruthToTracker(objects, annotations, args.matchingDistance, |
36 int(args.firstInstant), int(args.lastInstant)) | 39 firstInstant, lastInstant) |
37 #storage.deleteFromSqlite(args.databaseFilename, args.dataType) | |
38 | 40 |
41 # number of frames of existence of all objects within [firstInstant, lastInstant] | |
42 nTrackFrames = sum([min(o.getLastInstant(),lastInstant)-max(o.getFirstInstant(),firstInstant)+1 for o in objects]) | |
43 | |
44 print moving.computeClearMOT(matchTable, nTrackFrames) | |
45 |