Skip to content
Advertisement

ValueError: Expected x_max for bbox (0.65, 0.51, 1.12, 0.64, 3) to be in the range [0.0, 1.0], got 1.1234809015877545

I want to apply data augmentations from PyTorch’s Albumentations to images with bounding boxes.

When I apply the HorizontalFlip Transformation, I receive this error ValueError: Expected x_max for bbox (0.6505353259854019, 0.517013871576637, 1.1234809015877545, 0.6447916687466204, 3) to be in the range [0.0, 1.0], got 1.1234809015877545.

I use the following code

JavaScript

When I apply the Cutout transformation, I do not have any error regarding the bounding boxes

JavaScript

Advertisement

Answer

The bounding box exceeded the image since after the transformation it ends up being larger than the image size. Check carefully the dimensions of the bounding box.

Advertisement