Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the error when bbox dimensions gets less than 0 or greater than 1 #1278

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

POONAM2015
Copy link

image

@Dipet
Copy link
Collaborator

Dipet commented Sep 6, 2022

We can not change bboxes silently, because these changes might be incorrect in some cases. Better to add flag clamp_bbox=False into this function and into BboxParams and BboxProcessor

…boxes should be forcefully clamped to lie between 0 and 1
@POONAM2015
Copy link
Author

I have added the parameter clamp_bbox=False to BBoxParams which will control whether bboxes will be forcefully clamped to remain between 0 and 1.
Thanks.

Comment on lines 121 to 125
def convert_from_albumentations(self, data: Sequence, rows: int, cols: int) -> List[BoxType]:
return convert_bboxes_from_albumentations(data, self.params.format, rows, cols, check_validity=True)
return convert_bboxes_from_albumentations(data, self.params.format, rows, cols, check_validity=True, clamp_bbox=self.params.clamp_bbox)

def convert_to_albumentations(self, data: Sequence[BoxType], rows: int, cols: int) -> List[BoxType]:
return convert_bboxes_to_albumentations(data, self.params.format, rows, cols, check_validity=True)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You added this parameter to wrong function. You changed to function, but added param to from function. Please add small test to check that this functionality works coreectly

@Dipet Dipet added the wontfix This will not be worked on label Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants