# HG changeset patch # User Nicolas Saunier # Date 1502828155 14400 # Node ID 196a1fd498ba739ffe7ac3f1df137c23c43450a0 # Parent a15e843af55a1447e457e6ab13800a07f29626a7 removing unnecessary complexity of varying number of return elements diff -r a15e843af55a -r 196a1fd498ba python/moving.py --- a/python/moving.py Tue Aug 15 16:15:27 2017 -0400 +++ b/python/moving.py Tue Aug 15 16:15:55 2017 -0400 @@ -1810,6 +1810,9 @@ if returnMatches: gtMatches = {a.getNum():{} for a in annotations} toMatches = {o.getNum():{} for o in objects} + else: + gtMatches = None + toMatches = None for t in xrange(firstInstant, lastInstant+1): previousMatches = matches.copy() # go through currently matched GT-TO and check if they are still matched withing matchingDistance @@ -1881,10 +1884,7 @@ mota = 1.-float(mt+fpt+mme)/gt else: mota = None - if returnMatches: - return motp, mota, mt, mme, fpt, gt, gtMatches, toMatches - else: - return motp, mota, mt, mme, fpt, gt + return motp, mota, mt, mme, fpt, gt, gtMatches, toMatches def plotRoadUsers(objects, colors): '''Colors is a PlottingPropertyValues instance''' diff -r a15e843af55a -r 196a1fd498ba scripts/compute-clearmot.py --- a/scripts/compute-clearmot.py Tue Aug 15 16:15:27 2017 -0400 +++ b/scripts/compute-clearmot.py Tue Aug 15 16:15:55 2017 -0400 @@ -57,10 +57,7 @@ for a in annotations: a.shiftTimeInterval(args.nFramesOffsetAnnotations) -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) +motp, mota, mt, mme, fpt, gt, gtMatches, toMatches = moving.computeClearMOT(annotations, objects, args.matchingDistance, args.firstInstant, args.lastInstant, args.display) if args.csvOutput: print('{},{},{},{},{}'.format(motp, mota, mt, mme, fpt))