-
-
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
Added ConstrainedCoarseDropout class #2226
Added ConstrainedCoarseDropout class #2226
Conversation
Reviewer's Guide by SourceryThis pull request introduces a new transform called Sequence diagram for ConstrainedCoarseDropout transform operationsequenceDiagram
participant T as Transform
participant M as Mask
participant CV as OpenCV
participant H as Holes
T->>M: Get mask for specified classes
T->>CV: Find contours in mask
CV-->>T: Return contours
T->>CV: Get bounding boxes for contours
CV-->>T: Return bounding boxes
T->>H: Calculate hole dimensions
T->>H: Calculate hole positions
H-->>T: Return hole parameters
T->>M: Apply dropout to image and mask
Class diagram showing the new ConstrainedCoarseDropout class hierarchyclassDiagram
class BaseDropout {
+_targets: tuple[Targets, ...] | Targets
+fill: DropoutFillValue
+fill_mask: ColorType
}
class CoarseDropout {
+num_holes_range: tuple[int, int]
+hole_height_range: tuple[float, float]
+hole_width_range: tuple[float, float]
}
class ConstrainedCoarseDropout {
+num_holes_range: tuple[int, int]
+hole_height_range: tuple[float, float]
+hole_width_range: tuple[float, float]
+class_indices: list[int]
+calculate_constrained_hole_dimensions()
+get_hole_origin_coordinates()
+get_bbox_coords()
+get_foreground_objects_bounding_box_coords()
}
BaseDropout <|-- CoarseDropout
CoarseDropout <|-- ConstrainedCoarseDropout
note for ConstrainedCoarseDropout "New class that applies dropout only to specific object classes"
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 @vedantdalimkar - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider moving the README documentation link updates to a separate PR since they're unrelated to the ConstrainedCoarseDropout feature
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟡 Testing: 3 issues found
- 🟢 Complexity: all looks good
- 🟢 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.
@ternaus I have added some code for the test case which was failing. Sorry for the hiccup. All test cases are passing now. Are there any more issues to address with respect to the code? |
Added a new transform - Constrained coarse droput, which is a modification of the coarse dropout transform.
In constrained coarse dropout, rectangular regions are only dropped out from the foreground objects belonging to the class specified by the user.
Summary by Sourcery
Introduce the ConstrainedCoarseDropout transform. This transform drops out rectangular regions within user-specified foreground object classes, enhancing the CoarseDropout functionality.
New Features:
ConstrainedCoarseDropout
. This transform allows for dropping out rectangular regions exclusively from foreground objects belonging to specific user-defined classes.Tests:
ConstrainedCoarseDropout
transform.