Closed ternaus closed 5 months ago
This pull request introduces a new normalization feature for images, adding support for various normalization methods (image, image_per_channel, min_max, min_max_per_channel) using different backends (OpenCV, NumPy, and LUT). It also refactors existing functions to use a more modular approach and updates the benchmark and test files accordingly.
Files | Changes |
---|---|
albucore/functions.py albucore/utils.py |
Refactored existing functions and added new normalization functions with support for different backends and methods. |
benchmark/benchmark.py benchmark/results/float32_1.md benchmark/results/uint8_1.md |
Updated benchmark files to include new normalization methods and their results. |
tests/test_normalize_per_image.py |
Added comprehensive test cases for the new normalization functions. |
Attention: Patch coverage is 72.14612%
with 61 lines
in your changes missing coverage. Please review.
Please upload report for BASE (
main@35e25fc
). Learn more about missing BASE report.
Files | Patch % | Lines |
---|---|---|
benchmark/benchmark.py | 0.00% | 44 Missing :warning: |
tests/test_normalize_per_image.py | 80.39% | 10 Missing :warning: |
albucore/functions.py | 94.21% | 7 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Summary by Sourcery
This pull request introduces new normalization functions for images, refactors existing image processing operations into helper functions, and adds comprehensive tests to ensure the correctness of the new features. Additionally, it updates the pre-commit configuration to use the latest version of
ruff
.normalize_per_image_opencv
,normalize_per_image_numpy
, andnormalize_per_image_lut
for different normalization types including 'image', 'image_per_channel', 'min_max', and 'min_max_per_channel'.normalize_per_image
function that selects the appropriate normalization method based on the image data type and number of channels.apply_lut
,apply_opencv
,apply_numpy
) to streamline the code and reduce redundancy..pre-commit-config.yaml
to useruff
versionv0.4.8
.tests/test_normalize_per_image.py
to validate the new normalization functions across different data types and normalization methods.