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
Cannot load COCO dataset, when there are images without annotations #188
Comments
Hello there, thank you for opening an Issue ! 🙏🏻 The team was notified and they will get back to you asap. |
Hi! I’m one of the founders of Sweep, a github app that solves issues(like this bug) by writing pull requests. |
@lincoln2491 Thanks for reporting bug. We will try to fix it. |
@lincoln2491 I was able to reproduce the bug. But your dataset seems to have some issue. But I managed to test it with other dataset. I made a PR. |
@hardikdava Thanks for help. What do you mean by dataset have some issue? |
Hi @lincoln2491 👋🏻 Thanks for reporting the bug. I just took a look at @hardikdava PR, and it looks good. We will merge it to Remember that fix won't be accessible via
What @hardikdava meant is that your dataset contains images with no labels assigned. |
@wwzeng1 This issue is already solved. The app looks amazing. I'm happy to test it with another one. |
#192 merged! Closing the issue for now. @lincoln2491 feel free to reopen it if you will face more similar problems. |
@SkalskiP @hardikdava Hi, thanks for your help guys. |
@SkalskiP Gotcha, thanks for the heads up! Again, happy to help with anything :) |
Search before asking
Bug
I have a dataset (downloaded from roboflow) in COCO format. I tried to load using
dataset = sv.DetectionDataset.from_coco("dataset", "dataset/_annotations.coco.json")
but this throws an error:
has
I investigated what's going wrong and it turns out, that one of the images had no annotations.
This problem not occurs when datasets is in YOLO format and use
from_yolo
method.I check out that changing lines from 86 to 88 in
supervision.dataset.utils
fromto
will help with this issue.
Environment
abbde887dc380b0abd8065c21ebe10cf20efb2a2
contourpy 1.1.0
cycler 0.11.0
fonttools 4.40.0
kiwisolver 1.4.4
matplotlib 3.7.2
numpy 1.25.1
opencv-python 4.8.0.74
packaging 23.1
Pillow 10.0.0
pip 22.3.1
pyparsing 3.0.9
python-dateutil 2.8.2
PyYAML 6.0
setuptools 65.5.1
six 1.16.0
supervision 0.11.1
wheel 0.38.4
Minimal Reproducible Example
supervision_bug.zip
I made an example with a toy dataset to reproduce bug. Just run
test.py
. There are no annotations for image 1.jpgAdditional
No response
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: