-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 jpeg #2125
Add random jpeg #2125
Conversation
Reviewer's Guide by SourceryThis PR implements image compression functionality with support for JPEG and WebP formats, along with a new RandomJPEG transform. The implementation handles various channel configurations (grayscale, RGB, RGBA, and multi-channel images) and includes comprehensive test coverage for different image types and quality settings. Class diagram for the new RandomJPEG classclassDiagram
class RandomJPEG {
+tuple[int, int] jpeg_quality
+bool always_apply
+float p
+__init__(jpeg_quality: tuple[int, int] = (50, 50), always_apply: bool = False, p: float = 0.5)
+get_transform_init_args_names() tuple[str, ...]
}
class ImageCompression {
<<abstract>>
}
RandomJPEG --|> ImageCompression : Inherits
note for RandomJPEG "This is a specialized version of ImageCompression configured for JPEG only."
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 - here's some feedback:
Overall Comments:
- There's a duplicate test function name 'test_image_compression_quality' which should be renamed to avoid confusion
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟡 Testing: 1 issue found
- 🟡 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 #2125 +/- ##
=========================================
+ Coverage 0 90.30% +90.30%
=========================================
Files 0 48 +48
Lines 0 7787 +7787
=========================================
+ Hits 0 7032 +7032
- Misses 0 755 +755 ☔ View full report in Codecov by Sentry. |
Fixes: #2097
Summary by Sourcery
Add the RandomJPEG transform for applying random JPEG compression and enhance the image_compression function to support various channel configurations. Include new tests to ensure functionality and quality consistency.
New Features:
Enhancements:
Tests: