AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS'

Hello Everyone,
I am working on Automatic Number plate detection problem using opencv and yolo.
I am getting the below error when i pass the numpy array to easyocr readtext module
and i am running this project on WSL-2 and easyocr==1.7.0

    import easyocr
    reader = easyocr.Reader(['en'], gpu=False)
    
    print(type(license_plate_crop)) # <class 'numpy.ndarray'>
    print(license_plate_crop)
    detections = reader.readtext(license_plate_crop)

This is the error i am getting

line 619, in get_image_list
    crop_img,ratio = compute_ratio_and_resize(crop_img,width,height,model_height)
  File "/home/pranith_dev/Desktop/Datavoice/Automatic-License-Plate-Recognition-using-YOLOv8/dev-venv/lib/python3.10/site-packages/easyocr/utils.py", line 582, in compute_ratio_and_resize
    img = cv2.resize(img,(int(model_height*ratio),model_height),interpolation=Image.ANTIALIAS)
AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS'

I tried downgrading pillow version from 10.0.0 to 9.5 or 9.4 according to online solutions but the issue still persists and the following is the output

<class 'numpy.ndarray'>
[[255 255 255 ... 255 255 255]
 [255 255 255 ... 255 255 255]
 [255 255 255 ... 255 255 255]
 ...
 [255 255 255 ... 255 255 255]
 [255 255 255 ... 255 255 255]
 [255 255 255 ... 255 255 255]]
Illegal instruction

Hello @Pranith_Pashikanti

It doesn’t look like you’re using Roboflow and on the Roboflow forum, we only have the resources to provide support to the community for the Roboflow product or the content and resources we create.

It’s not clear where you got this code from, but I suggest reaching out to whoever authored it or refer to our resources on license plate recognition: