-
-
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
Fix blurs #2166
Conversation
Reviewer's Guide by SourceryThis PR fixes blur-related functionality by introducing a new utility function for sampling odd numbers and applying it consistently across different blur transforms. It also adds uint8_io decoration to median_blur and removes a float32-specific restriction. Sequence diagram for applying blur with sampled odd kernel sizesequenceDiagram
participant User
participant BlurTransform
participant fblur
User->>BlurTransform: apply(img, kernel, params)
BlurTransform->>fblur: sample_odd_from_range(py_random, blur_limit[0], blur_limit[1])
fblur-->>BlurTransform: odd kernel size
BlurTransform-->>User: blurred image
Class diagram for updated blur functionsclassDiagram
class BlurFunctions {
+median_blur(img: np.ndarray, ksize: int) np.ndarray
+sample_odd_from_range(random_state: Random, low: int, high: int) int
}
note for median_blur "Added uint8_io decorator and removed float32-specific restriction"
note for sample_odd_from_range "New utility function for sampling odd numbers"
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: 2 issues 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 #2166 +/- ##
=========================================
+ Coverage 0 89.76% +89.76%
=========================================
Files 0 47 +47
Lines 0 8477 +8477
=========================================
+ Hits 0 7609 +7609
- Misses 0 868 +868 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
Fixes: #2165
Summary by Sourcery
Fix the issue with median blur kernel size validation for float32 images and introduce a utility function to sample odd numbers from a range. Add tests for the new utility function to ensure its correctness.
Bug Fixes:
Enhancements:
Tests: