py-motmetrics
py-motmetrics copied to clipboard
KeyError while using compare_to_groundtruth
Hi,
I am was trying to generate results on MOT16 challenge results and used mm.utils.compare_to_groundtruth to get the accuracy but resulted in error.
df_gt = mm.io.loadtxt('MOT16/preds/MOT16-01/gt/det.txt')
df_test = mm.io.loadtxt('MOT16/preds/MOT16-01/gt/pretrained_pred.txt')
check = mm.utils.compare_to_groundtruth(df_gt, df_test, 'iou', distth=0.5)
ERROR
KeyError Traceback (most recent call last)
<ipython-input-102-df402fdf5fbc> in <module>
6
7 # df_test = mm.io.loadtxt(result)
----> 8 check = mm.utils.compare_to_groundtruth(df_gt, df_test, 'iou', distth=0.5)
9
~/opt/anaconda3/lib/python3.7/site-packages/motmetrics/utils.py in compare_to_groundtruth(gt, dt, dist, distfields, distth)
80 if len(oids) > 0 and len(hids) > 0:
81 dists = compute_dist(fgt.values, fdt.values)
---> 82 acc.update(oids, hids, dists, frameid=fid)
83
84 return acc
~/opt/anaconda3/lib/python3.7/site-packages/motmetrics/mot.py in update(self, oids, hids, dists, frameid, vf)
260 is_switch = (o in self.m and
261 self.m[o] != h and
--> 262 abs(frameid - self.last_occurrence[o]) <= self.max_switch_time)
263 cat1 = 'SWITCH' if is_switch else 'MATCH'
264 if cat1 == 'SWITCH':
KeyError: -1
I have same problem. did you solve?
@yunseung-dable I removed a couple of metrics and it worked fine. Was not able to corner out the issue
same problem
Same problem, when the customer ID is some specific number, it will reprot error