AttributeError module PIL Image has no attribute ANTIALIAS

AttributeError module PIL Image has no attribute ANTIALIAS

Error - img = cv2.resize(img,(int(model_height*ratio),model_height),interpolation=Image.ANTIALIAS)
AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS'


ANTIALIAS is no longer there in Pillow 10.0.0, it has been removed from current version of Pillow. One of the method to resolve this issue is to downgrade your current Pillow version from
Pillow 10.0.0 to Pillow Pillow==9.5.0



Follow below steps to downgrade pillow on Ubuntu 22.02, 20.04

pip uninstall Pillow
pip install Pillow==9.5.0

Send Query