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 for analyzing 2017 dataset #5

Closed
kampta opened this issue Dec 19, 2017 · 2 comments
Closed

KeyError for analyzing 2017 dataset #5

kampta opened this issue Dec 19, 2017 · 2 comments

Comments

@kampta
Copy link

kampta commented Dec 19, 2017

I ran run_analysis.py on output of 2017 keypoint challenge and got this error

Traceback (most recent call last):
  File "run_analysis.py", line 127, in <module>
    main()
  File "run_analysis.py", line 115, in main
    paths = occlusionAndCrowdingSensitivity( coco_analyze, .75, saveDir )
  File "/home/kamal/dev/coco-analyze/analysisAPI/occlusionAndCrowdingSensitivity.py", line 49, in occlusionAndCrowdingSensitivity
    total_gts += overlap_index[no]
KeyError: 7

Has something changed from 2014 keypoint challenge?

@mkocabas
Copy link

Hi @kampta, I got same error as you. Did you solve the issue?

@matteorr
Copy link
Owner

matteorr commented Feb 6, 2018

@kampta, @mkocabas: The error was due to a change in the COCO keypoints annotations from version 2014 to version 2017 and is solved by this commit.

The variables

IOU_FOR_OVERLAP = .1
overlap_groups  = [[0],[1,2],[3,4,5,6,7,8]]
num_kpt_groups  = [[1,2,3,4,5],[6,7,8,9,10],[11,12,13,14,15],[16,17]]

are defined for analyzing the sensitivity of performance to occlusion and crowding on benchmarks of the 2014 version of COCO. By combining every list for the number of overlapping annotations (overlap_groups) with every list for the number of visible keypoints (num_kpt_groups) you obtain 12 benchmarks. The specific grouping was defined so that the number of annotations in each benchmark was as close as possible.

The variables overlap_index and keypoints_index are dictionaries that respectively contain the list of all the ids of the annotations in the COCO dataset that have a certain number of overlapping annotations (with IoU > .1) and a certain number of visible keypoints.

The error at this line in occlusionAndCrowdingSensitivity.py occurs because the code is appending to the list total_gts all the annotations that have 7 other overlapping annotations (with IoU > .1) but there are none of them
in overlap_index because there are none in COCO 2017, hence the missing key for value 7.

So, while COCO 2014 had some annotations with 7 overlaps with IoU > 0.1, COCO 2017 does not. As a final note, you should keep in mind that the specific values for the overlap_groups and num_kpt_groups are arbitrary and you can change them to fit your needs and the analysis code will still work.

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

3 participants