PaddleOCR icon indicating copy to clipboard operation
PaddleOCR copied to clipboard

[WIP] upgrade to numpy 2.0 and remove imgaug

Open GreatV opened this issue 5 months ago • 0 comments

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: Replaced imgaug with albumentations for image augmentation, including the creation of specific methods for different transformations such as horizontal flip, affine, and resize. Simplified the build method and added error handling for unsupported transformations.

Dependency Updates:

  • pyproject.toml: Removed imgaug and added albumentations and albucore to dependencies. Updated the version constraint for numpy. [1] [2]

Testing:

  • tests/test_iaa_augment.py: Added extensive tests for the new augmentation logic using pytest. 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

GreatV avatar Oct 02 '24 03:10 GreatV