albumentations-team / albucore

A high-performance image processing library designed to optimize and extend the Albumentations library with specialized functions for advanced image transformations. Perfect for developers working in computer vision who require efficient and scalable image augmentation.
MIT License
12 stars 3 forks source link

Normalize by image #14

Closed ternaus closed 5 months ago

ternaus commented 5 months ago

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.

sourcery-ai[bot] commented 5 months ago

Reviewer's Guide by Sourcery

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.

File-Level Changes

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.
codecov-commenter commented 5 months ago

Codecov Report

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:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #14 +/- ## ======================================= Coverage ? 58.50% ======================================= Files ? 14 Lines ? 1176 Branches ? 0 ======================================= Hits ? 688 Misses ? 488 Partials ? 0 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.