Avoid ValueError for TFDS with BBox on the last pixel
## What this patch does to fix the issue.
Fix
## Link to any relevant issues or pull requests.
@@ -77,8 +77,8 @@ class ObjectDetectionBuilder(tfds.core.GeneratorBasedBuilder):
"bbox": tfds.features.BBox(
ymin / height,
xmin / width,
- (ymin + h) / height,
- (xmin + w) / width,
+ min((ymin + h) / height, 1.0),
+ min((xmin + w) / width, 1.0),
)
}
for xmin, ymin, w, h, label in annotations
