-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Fix in PixelDropout #2389
Fix in PixelDropout #2389
Conversation
Reviewer's Guide by SourceryThis pull request relocates the Sequence diagram for PixelDropout::apply_to_bboxessequenceDiagram
participant PixelDropout
participant BboxProcessor
participant fdropout
participant fmain
PixelDropout->PixelDropout: apply_to_bboxes(bboxes, drop_mask, params)
alt drop_mask is None or per_channel is True
PixelDropout-->PixelDropout: return bboxes
else
PixelDropout->PixelDropout: get_processor("bboxes")
alt processor is None
PixelDropout-->PixelDropout: return bboxes
else
PixelDropout->fmain: denormalize_bboxes(bboxes, image_shape)
fmain-->PixelDropout: denormalized_bboxes
alt per_channel and len(drop_mask.shape) > 2
PixelDropout->np: any(drop_mask, axis=-1)
np-->PixelDropout: combined_mask
else
PixelDropout->PixelDropout: combined_mask = drop_mask
end
PixelDropout->fdropout: mask_dropout_bboxes(denormalized_bboxes, combined_mask, image_shape, min_area, min_visibility)
fdropout-->PixelDropout: result
PixelDropout->fmain: normalize_bboxes(result, image_shape)
fmain-->PixelDropout: normalized_bboxes
PixelDropout-->PixelDropout: return normalized_bboxes
end
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ternaus - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider adding a test case that specifically checks the scenario where
per_channel=True
and its impact on bounding boxes. - The logic for handling bounding boxes when
per_channel
is True seems complex; consider simplifying it if possible.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟡 Complexity: 2 issues found
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Summary by Sourcery
This pull request fixes an issue with the PixelDropout transform where bounding boxes were not being correctly handled when the per_channel option was enabled. It also moves the PixelDropout transform to the dropout module.
Enhancements: