PaddleOCR
PaddleOCR copied to clipboard
[WIP] upgrade to numpy 2.0 and remove imgaug
This pull request introduces significant changes to the image augmentation functionality, switching from the imgaug
library to albumentations
, and adds comprehensive tests for the new implementation. The most important changes include refactoring the augmentation logic, updating dependencies, and adding new tests.
Refactoring and Enhancements:
-
ppocr/data/imaug/iaa_augment.py
: Replacedimgaug
withalbumentations
for image augmentation, including the creation of specific methods for different transformations such as horizontal flip, affine, and resize. Simplified thebuild
method and added error handling for unsupported transformations.
Dependency Updates:
-
pyproject.toml
: Removedimgaug
and addedalbumentations
andalbucore
to dependencies. Updated the version constraint fornumpy
. [1] [2]
Testing:
-
tests/test_iaa_augment.py
: Added extensive tests for the new augmentation logic usingpytest
. Tests cover default augmentation, no augmentation, various resize scenarios, custom augmentation, error handling for unknown transforms and invalid parameters, and multiple transformations.
Related PR:
- https://github.com/PaddlePaddle/PaddleOCR/pull/13467