Yolo boxes format overflowing image and thowing an exception
See original GitHub issue🐛 Bug
I have some bounding boxes in yolo format that are off the image.
To Reproduce
- Have boxes outside image in yolo format and try to augment
\lib\site-packages\albumentations\augmentations\bbox_utils.py", line 330, in check_bbox “to be in the range [0.0, 1.0], got {value}.”.format(bbox=bbox, name=name, value=value) ValueError: Expected x_max for bbox (0.9967206790123457, 0.5379050925925926, 1.0001929012345678, 0.5529513888888888, 0) to be in the range [0.0, 1.0], got 1.0001929012345678.
Expected behavior
I would prefer it to clip the boxes, or at least give me the option to do so.
Environment
- Albumentations version (e.g., 0.1.8): 0.5.2
- Python version (e.g., 3.7): 3.6
- OS (e.g., Linux): Windows
- How you installed albumentations (
conda
,pip
, source): pip - Any other relevant information:
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
ValueError: Expected x_max for bbox to be in the range [0.0 ...
Bug I tried to transform images using RandomResizedCrop with its bounding box (yolo format). But, there are images that when the program ...
Read more >Yolo V5 issue "Exception: Dataset not found." on local machine
I have a train, test and valid files that contain all the image and labels files. I have tested the files on googlecolap...
Read more >Import pre-annotated data into Label Studio
Import predicted labels, predictions, pre-annotations, or pre-labels into Label Studio for your data labeling, machine learning, and data science projects.
Read more >Detect and Track Objects with ML Kit on Android - Firebase
When you pass ML Kit images, ML Kit returns, for each image, a list of up to five detected objects and their position...
Read more >'function' object has no attribute 'drop'
'function' Object Has No Attribute 'drop'Passing a string of a filename will save the screenshot to a file as well as return it...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The image might be proprietary, but here is one box causing the issue:
Yolo Format: [0.99662423, 0.7520255 , 0.00675154, 0.01446759]
My albumentations conversion: [0.99324846, 0.7447917, 1.0, 0.7592593]
Exception for this box: Exception has occurred: ValueError Expected x_max for bbox (0.9934413580246914, 0.7450810185185185, 1.0001929012345678, 0.7592592592592593, 0) to be in the range [0.0, 1.0], got 1.0001929012345678.
My conversion code:
Should be fixed by #924