-
-
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
Add random erasing #2136
Add random erasing #2136
Conversation
Reviewer's Guide by SourceryThis PR implements Random Erasing data augmentation by adding two new transforms: Class diagram for the new Erasing and RandomErasing classesclassDiagram
class BaseDropout {
<<abstract>>
}
class Erasing {
+tuple[float, float] scale
+tuple[float, float] ratio
+DropoutFillValue fill_value
+ColorType mask_fill_value
+float p
+get_params_dependent_on_data(params: dict[str, Any], data: dict[str, Any]) dict[str, Any]
+get_transform_init_args_names() tuple[str, ...]
}
class RandomErasing {
+tuple[float, float] scale
+tuple[float, float] ratio
+float | tuple[float, ...] | Literal["random"] value
+float p
+get_transform_init_args_names() tuple[str, ...]
}
BaseDropout <|-- Erasing
Erasing <|-- RandomErasing
note for Erasing "Implements Random Erasing Data Augmentation"
note for RandomErasing "Alias for Erasing with torchvision-compatible parameters"
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 and they look great!
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟡 Testing: 1 issue found
- 🟡 Complexity: 1 issue 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.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2136 +/- ##
=========================================
+ Coverage 0 90.35% +90.35%
=========================================
Files 0 48 +48
Lines 0 7975 +7975
=========================================
+ Hits 0 7206 +7206
- Misses 0 769 +769 ☔ View full report in Codecov by Sentry. |
Fixes: #2084
Summary by Sourcery
Add new 'Erasing' and 'RandomErasing' augmentation classes to support random erasing of image regions, enhancing model robustness. Update documentation and tests to reflect these additions.
New Features:
Documentation:
Tests: