-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
IndexError: index 8 is out of bounds for axis 0 with size 7 #33
Comments
Hello @robmarkcole , could you share your dataset with me? That will help me to debug the issue |
Thank you. I will try to check it today
…On Fri, Mar 11, 2022 at 7:52 AM Robin Cole ***@***.***> wrote:
Hi @alexheat <https://github.com/alexheat>
it is https://www.kaggle.com/towardsentropy/oil-storage-tanks
—
Reply to this email directly, view it on GitHub
<pylabel-project/pylabel#33>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC5OL775ZZRSRVMYNJKC5ODU7NT3NANCNFSM5QPYAFWA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hello @robmarkcole I figured out what the problem is. The .json file for that dataset is missing some of the fields that are usually in a COCO annotation file. For example it doesn't have the height or width of the images:
It also doesn't have some of the usual metadata about the annotations. Unfortunately this library won't work with that dataset. If you are really stuck I can try and help work around the issue. (Which would require some more Python code to either augment the JSON or borrow some code from this library or add some additional logic to this library.) |
@alexheat do you know of any validators that could be run against the file? Did a brief search but did not find one, although https://github.com/levan92/cocojson looks useful here |
I am not aware of any validation tool or even an official place where the schema is documented. But the image height and width are included in the original COCO dataset. The height and width are required information to convert to other formats like YOLO because it requires calculating the size of the bounding box relative to the size of the image. |
this looks like the spec https://cocodataset.org/#format-data for this issue, I suggest raising an exception if the keys are missing. |
I have updated the json file but still get the error... file on https://gist.github.com/robmarkcole/286951efe0830d3e205666f68c2b490e Possibly due to mismatch of keys using for entry in in_json['annotations']:
id = entry['image_id']
entry['id'] = id Possibly some conflict as raised in cocodataset/cocoapi#95 Alternatively, might be due to some images having no annotations? Nope, remove those and still error |
OK the issue was missing |
Thank you. Glad you got it working. I will keep the issue open as a reminder to add the better error handling. |
Code:
Error:
The text was updated successfully, but these errors were encountered: