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

Is there a way to use PythonAPI loadRes and COCOeval with empty detections? #675

Open
tomikoskinen opened this issue Sep 23, 2024 · 0 comments

Comments

@tomikoskinen
Copy link

tomikoskinen commented Sep 23, 2024

I am trying to run a simple evaluation:

    cocoGt = COCO(json_gt_path)
    cocoDt = cocoGt.loadRes(json_pr_path)
    cocoEval = COCOeval(cocoGt, cocoDt, "bbox")
    cocoEval.evaluate()
    cocoEval.accumulate()
    cocoEval.summarize()

, where my detector did not detect any box-annotations, so json_pr_path only has an empty array [].
This leads to an error in coco.loadRes:

pycocotools/coco.py", line 335, in loadRes if 'caption' in anns[0]: ~~~~^^^ IndexError: list index out of range

Is there a way to use these functions and evaluate with zero predicted/detected boxes?

@tomikoskinen tomikoskinen changed the title Is there a way to use PythonAPI loadRes and COCOeval with empty annotations? Is there a way to use PythonAPI loadRes and COCOeval with empty detections? Sep 23, 2024
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

1 participant