Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError while using compare_to_groundtruth #129

Open
amitbcp opened this issue Nov 19, 2020 · 4 comments
Open

KeyError while using compare_to_groundtruth #129

amitbcp opened this issue Nov 19, 2020 · 4 comments

Comments

@amitbcp
Copy link

amitbcp commented Nov 19, 2020

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

pretrained_pred.txt
det.txt
finetuned_pred.txt

@yunseung-dable
Copy link

I have same problem. did you solve?

@amitbcp
Copy link
Author

amitbcp commented Jul 4, 2021

@yunseung-dable I removed a couple of metrics and it worked fine. Was not able to corner out the issue

@LingyvKong
Copy link

same problem

@tchen0623
Copy link

Same problem, when the customer ID is some specific number, it will reprot error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants