Skip to content

Fix empty crop_boxes shape in automatic mask generation - #766

Open
Dev-Aayush-Kumar wants to merge 1 commit into
facebookresearch:mainfrom
Dev-Aayush-Kumar:fix-681-automatic-mask-generator-crop-boxes
Open

Dev-Aayush-Kumar wants to merge 1 commit into
facebookresearch:mainfrom
Dev-Aayush-Kumar:fix-681-automatic-mask-generator-crop-boxes

Conversation

@Dev-Aayush-Kumar

Copy link
Copy Markdown

Summary

Fixes #681.

When automatic mask generation uses multiple crops and every crop
produces zero surviving masks, crop_boxes can become a 1-D empty
tensor with shape (0,).

This causes box_area() to fail when cross-crop mask deduplication
runs.

This change preserves the expected (N, 4) shape, including
the zero-mask case.

Testing

  • Added a regression test covering zero detections across multiple crops.
  • Added a sanity test for the single-crop zero-detection path.
  • Both tests pass.

No public APIs were changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bugfix: Dimension Mismatch in AutoMaskGenerator

1 participant