-
-
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 time masking #2122
Add time masking #2122
Conversation
Reviewer's Guide by SourceryThis PR introduces a new TimeMasking transform for spectrograms, which is implemented as a specialized version of XYMasking. The implementation also includes bug fixes for handling empty holes in dropout-based transforms and adds deprecation warnings for TimeReverse transform. Class diagram for the new TimeMasking transformclassDiagram
class XYMasking {
<<abstract>>
+apply(img: np.ndarray, holes: np.ndarray, seed: int, **params: Any): np.ndarray
+apply_to_mask(mask: np.ndarray, holes: np.ndarray, seed: int, **params: Any): np.ndarray
+apply_to_bboxes(bboxes: np.ndarray, holes: np.ndarray, **params: Any): np.ndarray
+apply_to_keypoints(keypoints: np.ndarray, holes: np.ndarray, **params: Any): np.ndarray
}
class TimeMasking {
+time_mask_param: int
+apply(img: np.ndarray, holes: np.ndarray, seed: int, **params: Any): np.ndarray
+apply_to_mask(mask: np.ndarray, holes: np.ndarray, seed: int, **params: Any): np.ndarray
+apply_to_bboxes(bboxes: np.ndarray, holes: np.ndarray, **params: Any): np.ndarray
+apply_to_keypoints(keypoints: np.ndarray, holes: np.ndarray, **params: Any): np.ndarray
+get_transform_init_args_names(): tuple[str, ...]
}
XYMasking <|-- TimeMasking
note for TimeMasking "TimeMasking is a specialized version of XYMasking for time domain masking."
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: 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.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2122 +/- ##
=========================================
+ Coverage 0 90.24% +90.24%
=========================================
Files 0 47 +47
Lines 0 7738 +7738
=========================================
+ Hits 0 6983 +6983
- Misses 0 755 +755 ☔ View full report in Codecov by Sentry. |
Fixes: #2074
Summary by Sourcery
Add the TimeMasking transform to the library, allowing for time domain masking of spectrograms. Fix issues related to empty 'holes' arrays in transformations. Enhance user guidance with warnings about transform usage and update documentation to reflect new features.
New Features:
Bug Fixes:
Enhancements:
Documentation:
Tests: