🛠️ This fork of
imgaugincludes a compatibility fix for NumPy 2.0+, which removed thenp.sctypesattribute.
Based on a solution proposed by @qja1998 in an issue on the original repository.
In imgaug/parameters.py, this code:
NP_FLOAT_TYPES = set(np.sctypes["float"])
NP_INT_TYPES = set(np.sctypes["int"])
NP_UINT_TYPES = set(np.sctypes["uint"])Has been replaced with:
NP_FLOAT_TYPES = {np.float16, np.float32, np.float64}
NP_INT_TYPES = {np.int8, np.int16, np.int32, np.int64}
NP_UINT_TYPES = {np.uint8, np.uint16, np.uint32, np.uint64}This resolves an AttributeError when using imgaug with NumPy 2.0 or later.
Install this patched version directly using pip:
pip install git+https://github.com/pbarbadol/imgaug.git@v0.4.1-fixnp- Python ≥ 3.7
- NumPy ≥ 2.0.0
- Based on
imgaugv0.4.0
- Original library: aleju/imgaug
- Fix proposed by @qja1998
- Fork maintained by @pbarbadol
This fork follows the MIT License of the original project.
This Python library helps you with augmenting images for your machine learning projects.
It converts a set of input images into a new, much larger set of slightly altered images.