Closed ternaus closed 1 week ago
This pull request adds inplace operation support to various image processing functions by modifying the clip function and adding inplace parameters to several operations. The changes primarily affect array operations like add, multiply, and normalize.
classDiagram
class functions {
+add_weighted_simsimd(np.ndarray img1, float weight1, np.ndarray img2, float weight2)
+apply_lut(np.ndarray img, ...)
+multiply(np.ndarray img, ValueType value, bool inplace)
+add_opencv(np.ndarray img, np.ndarray|float value, bool inplace)
+add_numpy(np.ndarray img, np.ndarray|float value)
+add_lut(np.ndarray img, np.ndarray|float value, bool inplace)
+add_constant(np.ndarray img, float value, bool inplace)
+add_vector(np.ndarray img, np.ndarray value, bool inplace)
+add_array(np.ndarray img, np.ndarray value, bool inplace)
+add(np.ndarray img, ValueType value, bool inplace)
+normalize_numpy(np.ndarray img, float|np.ndarray mean, float|np.ndarray denominator)
+add_weighted_numpy(np.ndarray img1, float weight1, np.ndarray img2, float weight2)
+add_weighted_opencv(np.ndarray img1, float weight1, np.ndarray img2, float weight2)
+add_weighted_lut(np.ndarray img1, float weight1, np.ndarray img2, float weight2, bool inplace)
+multiply_add_lut(np.ndarray img, ValueType factor, ValueType value, bool inplace)
+to_float(np.ndarray img, float|None max_value)
+from_float_numpy(np.ndarray img, np.dtype target_dtype, float|None max_value)
}
class utils {
+clip(np.ndarray img, Any dtype, bool inplace)
}
Change | Details | Files |
---|---|---|
Added inplace operation support to the clip function |
|
albucore/utils.py |
Added inplace parameter support to array operations |
|
albucore/functions.py |
Updated benchmark results for various operations |
|
benchmark/albucore_benchmark/results/float32_1/*.md benchmark/albucore_benchmark/results/float32_3/*.md benchmark/albucore_benchmark/results/float32_5/*.md benchmark/albucore_benchmark/results/uint8_1/*.md benchmark/albucore_benchmark/results/uint8_3/*.md benchmark/albucore_benchmark/results/uint8_5/*.md |
Attention: Patch coverage is 91.30435%
with 2 lines
in your changes missing coverage. Please review.
Please upload report for BASE (
main@f5eb6c6
). Learn more about missing BASE report.
Files with missing lines | Patch % | Lines |
---|---|---|
albucore/functions.py | 89.47% | 2 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Summary by Sourcery
Enhance image processing functions to support in-place operations, improving memory efficiency. Update pre-commit hooks to newer versions and add comprehensive benchmark tests for performance evaluation. Update documentation to reflect these changes and improvements.
Enhancements:
Build:
Documentation:
Tests: