-
-
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 transforms #2147
Add transforms #2147
Conversation
Reviewer's Guide by SourceryThe PR refactors the Solarize transform to use normalized threshold values and introduces a new RandomSolarize transform for Kornia API compatibility. The main changes involve modifying the threshold parameter to use a normalized range [0,1] instead of absolute values, improving the handling of both uint8 and float32 images, and adding comprehensive documentation. Class diagram for Solarize and RandomSolarize transformsclassDiagram
class Solarize {
- threshold: ScaleFloatType | None
+ threshold_range: tuple[float, float]
+ apply(img: np.ndarray, threshold: float) np.ndarray
+ get_params() dict[str, float]
+ get_transform_init_args_names() tuple[str, ...]
}
class RandomSolarize {
+ thresholds: tuple[float, float]
+ get_transform_init_args_names() tuple[str, ...]
}
Solarize <|-- RandomSolarize
note for Solarize "Refactored to use threshold_range instead of threshold"
note for RandomSolarize "New class introduced for Kornia API compatibility"
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: 2 issues 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 ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2147 +/- ##
=========================================
+ Coverage 0 90.38% +90.38%
=========================================
Files 0 48 +48
Lines 0 8084 +8084
=========================================
+ Hits 0 7307 +7307
- Misses 0 777 +777 ☔ View full report in Codecov by Sentry. |
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: 2 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 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.
Fixes: #2111
Summary by Sourcery
Refactor the 'Solarize' transform to use a 'threshold_range' parameter for more flexible threshold specification and introduce a new 'RandomSolarize' transform for compatibility with Kornia API naming conventions. Update tests and documentation accordingly, and adjust the 'setup.py' to require a newer version of 'pydantic'.
New Features:
Enhancements:
Documentation:
Tests:
Chores:
Summary by Sourcery
Refactor the 'Solarize' transform to use a 'threshold_range' parameter for more flexible threshold specification and introduce a new 'RandomSolarize' transform for compatibility with Kornia API naming conventions. Update tests and documentation accordingly.
New Features:
Enhancements:
Documentation:
Tests:
Chores: