This repository was archived by the owner on Jul 10, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fix move_tone_curve function #2563
Merged
ternaus
merged 2 commits into
albumentations-team:main
from
trylinka:apply-to-images-random-tone-curve
Jun 18, 2025
Merged
Fix move_tone_curve function #2563
ternaus
merged 2 commits into
albumentations-team:main
from
trylinka:apply-to-images-random-tone-curve
Jun 18, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Reviewer's GuideThis PR refactors the tone curve adjustment by externalizing Bezier evaluation, enforcing explicit channel counts throughout the transform API, introducing spatial‐dimension utilities, and aligning tests with the new per‐channel behavior. Entity relationship diagram for per-channel tone curve applicationerDiagram
IMAGE ||--o{ CHANNEL : has
CHANNEL {
float low_y
float high_y
}
IMAGE {
int num_channels
}
Class diagram for updated tone curve transform methodsclassDiagram
class ToneCurveTransform {
+apply(img, low_y, high_y, num_channels, **params)
+apply_to_images(images, low_y, high_y, num_channels, **params)
+apply_to_volume(volume, low_y, high_y, num_channels, **params)
+apply_to_volumes(volumes, low_y, high_y, num_channels, **params)
+get_params_dependent_on_data(data)
}
class fpixel {
+move_tone_curve(img, low_y, high_y, num_channels)
+evaluate_bez(low_y, high_y)
}
ToneCurveTransform --> fpixel : uses
Class diagram for new and refactored tone curve functional utilitiesclassDiagram
class fpixel {
+move_tone_curve(img, low_y, high_y, num_channels)
+evaluate_bez(low_y, high_y)
}
fpixel : move_tone_curve now requires num_channels
fpixel : evaluate_bez extracted as standalone utility
Class diagram for new spatial dimension utilitiesclassDiagram
class spatial_utils {
+get_spatial_dims_from_shape(shape)
+construct_shape_with_spatial_dims(base_shape, spatial_dims)
+extract_spatial_dimensions(shape) <<deprecated>>
}
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.
@sourcery-ai review |
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.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary by Sourcery
Update move_tone_curve transform to accept and propagate channel count, extend it for batched and volumetric inputs, refactor its implementation for clarity, and adjust parameter logic and tests accordingly
New Features:
Bug Fixes:
Enhancements:
Tests: