-
-
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 horizontal flip #2126
Conversation
Reviewer's Guide by SourceryThis PR adds a new RandomHorizontalFlip transform class that serves as an alias for the existing HorizontalFlip transform. The implementation is designed to maintain API compatibility with torchvision and Kornia libraries, making it easier for users to migrate from these libraries to albumentations. Class diagram for the new RandomHorizontalFlip classclassDiagram
class RandomHorizontalFlip {
+float p = 0.5
+bool|None always_apply
+_targets: (Targets.IMAGE, Targets.MASK, Targets.BBOXES, Targets.KEYPOINTS)
+InitSchema InitSchema
+__init__(p: float = 0.5, always_apply: bool | None = None)
}
class HorizontalFlip
RandomHorizontalFlip --|> HorizontalFlip
class Targets {
<<enumeration>>
IMAGE
MASK
BBOXES
KEYPOINTS
}
class BaseTransformInitSchema
RandomHorizontalFlip ..> BaseTransformInitSchema : uses
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: all looks good
- 🟢 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 #2126 +/- ##
=========================================
+ Coverage 0 90.34% +90.34%
=========================================
Files 0 48 +48
Lines 0 7797 +7797
=========================================
+ Hits 0 7044 +7044
- Misses 0 753 +753 ☔ View full report in Codecov by Sentry. |
Fixes: #2079
Summary by Sourcery
Add RandomHorizontalFlip as an alias for HorizontalFlip to maintain compatibility with torchvision and Kornia APIs, update documentation, and include tests for the new transform.
New Features:
Documentation:
Tests: