Skip to content

Commit baa7fe0

Browse files
pierrot0The TensorFlow Datasets Authors
authored and
The TensorFlow Datasets Authors
committed
fix bounding boxes features for numpy2.
PiperOrigin-RevId: 668452078
1 parent 0f60098 commit baa7fe0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tensorflow_datasets/core/features/bounding_boxes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def encode_example(self, bbox: Union[bb_utils.BBox, np.ndarray]):
8888

8989
# Validate the coordinates
9090
for coordinate in bbox:
91-
if not isinstance(coordinate, float):
91+
if not isinstance(coordinate, (float, np.floating)):
9292
raise ValueError(
9393
'BBox coordinates should be float. Got {}.'.format(bbox)
9494
)

0 commit comments

Comments
 (0)