-
-
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
Update longest and shortest maxsize #2209
Conversation
Reviewer's Guide by SourceryThis pull request refactors the Class diagram showing the new MaxSizeTransform hierarchyclassDiagram
class DualTransform {
<<abstract>>
}
class MaxSizeTransform {
<<abstract>>
+max_size: int|list[int]|None
+max_size_hw: tuple[int|None, int|None]|None
+interpolation: int
+mask_interpolation: int
+apply(img, scale)
+apply_to_mask(mask, scale)
+apply_to_keypoints(keypoints, scale)
}
class LongestMaxSize {
+get_params_dependent_on_data()
}
class SmallestMaxSize {
+get_params_dependent_on_data()
}
DualTransform <|-- MaxSizeTransform
MaxSizeTransform <|-- LongestMaxSize
MaxSizeTransform <|-- SmallestMaxSize
note for MaxSizeTransform "New base class that handles
common resize functionality"
note for LongestMaxSize "Scales based on longest side"
note for SmallestMaxSize "Scales based on smallest side"
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: all looks good
- 🟡 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 #2209 +/- ##
=========================================
+ Coverage 0 89.28% +89.28%
=========================================
Files 0 50 +50
Lines 0 8982 +8982
=========================================
+ Hits 0 8020 +8020
- Misses 0 962 +962 ☔ View full report in Codecov by Sentry. |
Summary by Sourcery
Refactor
LongestMaxSize
andSmallestMaxSize
transforms to inherit from a common base classMaxSizeTransform
. Introducemax_size_hw
parameter for specifying resize constraints by height and width. Update tests and functional implementations accordingly.New Features:
max_size_hw
parameter toLongestMaxSize
andSmallestMaxSize
to support resizing by height and width constraints.Tests:
max_size_hw
parameter and refactor existing tests.