From ee534743155305b351cc12651dd51d5a73d48379 Mon Sep 17 00:00:00 2001 From: Hideaki Masuda Date: Thu, 24 Sep 2020 18:07:12 +0900 Subject: [PATCH] Avoid ValueError for TFDS with BBox on the last pixel (#1209) ## What this patch does to fix the issue. Fix #1208 ## Link to any relevant issues or pull requests. --- blueoil/utils/tfds_builders/object_detection.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blueoil/utils/tfds_builders/object_detection.py b/blueoil/utils/tfds_builders/object_detection.py index 280c85354..17f7e30d5 100644 --- a/blueoil/utils/tfds_builders/object_detection.py +++ b/blueoil/utils/tfds_builders/object_detection.py @@ -77,8 +77,8 @@ def _generate_examples(self, dataset): "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