fix convert_bbox_to_albumentations when x_max > rows #770
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
convert_bbox_to_albumentations([0.53125, 0.551471, 0.9375, 0.736928] , 'yolo, 608, 608, check_validity=True) == ValueError: Expected x_max for bbox (0.06414473684210527, 0.18421052631578946, 1.0016447368421053, 0.9210526315789473, 0) to be in the range [0.0, 1.0], got 1.0016447368421053.
Happens because in "convert_bbox_to_albumentations" after x_max = int(x_min + width), x_max == 609, but rows == 608.
x_max = int(x_min + width) - 1 fix it.