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

Handling zero height/width when resizing images #569

Merged
merged 3 commits into from
Sep 9, 2022
Merged

Conversation

brimoor
Copy link
Contributor

@brimoor brimoor commented Sep 5, 2022

eta.core.image.resize() was not previously robust to degenerate cases where an input/output width/height was zero. This PR resolves that.

import fiftyone as fo
import numpy as np

detection = fo.Detection(
    label="empty",
    bounding_box=[0, 0, 0, 0],
    mask=np.zeros((0, 0)),
)

# Previously would raise an error; now succeeds
segmentation = detection.to_segmentation(frame_size=(32, 32))

@brimoor brimoor added the bug Bug fixes label Sep 5, 2022
@brimoor brimoor requested a review from a team September 5, 2022 22:43
@brimoor brimoor self-assigned this Sep 5, 2022
Copy link
Contributor

@benjaminpkane benjaminpkane left a comment

Choose a reason for hiding this comment

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

LGTM

@brimoor brimoor merged commit 60db1fc into develop Sep 9, 2022
@brimoor brimoor deleted the bugfix/resize branch September 9, 2022 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants