Open ArtDoctor opened 1 year ago
Some update: downgrading Pillow to 9.5.0 fixes this issue, but I think it will be a good idea to also change the ANTIALIAS parameter in the easyocr\utils.py too.
I met the same error just now, now i ll try your method
It works,very thanks
Same issue. Can you please provide how to change the ANTIALIAS parameter in the easyocr\utils.py
I think, it's easier for you to just reinstall the PIL package. Try running this in the console/terminal:
pip install --force-reinstall -v "Pillow==9.5.0"
After this it should work.
I think, it's easier for you to just reinstall the PIL package. Try running this in the console/terminal:
pip install --force-reinstall -v "Pillow==9.5.0"
After this it should work.
This works thanks I've got the issue right now but it would be great to make it compatible with newer versions.
It seems like PIL.Image.LANCZOS
or PIL.Image.Resampling.LANCZOS
need to be used to achieve the same thing.
Thank You
pip install --force-reinstall -v "Pillow==9.5.0"
It works for me. Thanks
Same issue. Can you please provide how to change the ANTIALIAS parameter in the easyocr\utils.py
Same issue. Can you please provide how to change the ANTIALIAS parameter in the easyocr\utils.py
Use PILOW==9.5.0 as workaround. That worked for me.
I think, it's easier for you to just reinstall the PIL package. Try running this in the console/terminal:
pip install --force-reinstall -v "Pillow==9.5.0"
After this it should work.
Thankyou. Currently using Pillow 10.0.0. Then downgrade. It's work.
I think, it's easier for you to just reinstall the PIL package. Try running this in the console/terminal:
pip install --force-reinstall -v "Pillow==9.5.0"
After this it should work.
you just saved my life thank you
Having the same issue. I'll give the PIL older version a try. I agree that easyocr should be adjusted for newer PIL versions. Or at least give people a heads up at installation documentation.
This issue is fixed in the master branch. You can install the master branch via: pip install git+https://github.com/JaidedAI/EasyOCR.git
Back installing worked for me. As well as installing from the the git master as archywillh mentioned worked for me as well. Thank you archywillhe for that info by the way. Additional question. If you don't mind me asking so I can better assist myself in the future, where did you find the info that the master branch had a fix for this?
Pillow to 9.5.0
working with me,thanks you
I've had this problem for a long time, thanks for your help
When forced to find another solution, this also worked for me:
import PIL
PIL.Image.ANTIALIAS = PIL.Image.LANCZOS
Insert before the call to easyocr's readtext() (or other) method.
When forced to find another solution, this also worked for me:
import PIL PIL.Image.ANTIALIAS = PIL.Image.LANCZOS
Insert before the call to easyocr's readtext() (or other) method.
Much better than downgrading PIL. Thank you!
When forced to find another solution, this also worked for me:
import PIL PIL.Image.ANTIALIAS = PIL.Image.LANCZOS
Insert before the call to easyocr's readtext() (or other) method.
Heroic thanks!
When forced to find another solution, this also worked for me:
import PIL PIL.Image.ANTIALIAS = PIL.Image.LANCZOS
Insert before the call to easyocr's readtext() (or other) method.
Thanks ! you saved my day
When forced to find another solution, this also worked for me:
import PIL PIL.Image.ANTIALIAS = PIL.Image.LANCZOS
Insert before the call to easyocr's readtext() (or other) method.
Its a good idea!!!
Hey @patrickmappedin, I have tried both the approaches a. Downgrading pillow b. PIL.Image.ANTIALIAS = PIL.Image.LANCZOS
but i am getting error like Illegal instruction You can read my post for more info
Some update: downgrading Pillow to 9.5.0 fixes this issue, but I think it will be a good idea to also change the ANTIALIAS parameter in the easyocr\utils.py too.
its work thanks
THANKS
On Tue, Aug 13, 2024 at 1:52 PM Rashid Rysaev @.***> wrote:
When forced to find another solution, this also worked for me:
import PIL PIL.Image.ANTIALIAS = PIL.Image.LANCZOS
Insert before the call to easyocr's readtext() (or other) method.
Works like a charm, God bless
— Reply to this email directly, view it on GitHub https://github.com/JaidedAI/EasyOCR/issues/1077#issuecomment-2285715169, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZGHA3YOFT4QNERXSX2Z233ZRHCM7AVCNFSM6AAAAAA2DQJ3JKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOBVG4YTKMJWHE . You are receiving this because you commented.Message ID: @.***>
When I try to use easyocr on any image, I get this error: AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS'
According to (https://stackoverflow.com/questions/76616042/attributeerror-module-pil-image-has-no-attribute-antialias), new version of PIL (10.0.0) has no ANTIALIAS, as it's deprecated.
Full error:
File "...", line 8, in convert_img_to_text result = reader.readtext(img_path) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "...\venv\Lib\site-packages\easyocr\easyocr.py", line 464, in readtext result = self.recognize(img_cv_grey, horizontal_list, free_list,\ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "...\venv\Lib\site-packages\easyocr\easyocr.py", line 383, in recognize image_list, max_width = get_image_list(h_list, f_list, img_cv_grey, model_height = imgH) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "...\venv\Lib\site-packages\easyocr\utils.py", line 613, in get_image_list crop_img,ratio = compute_ratio_and_resize(crop_img,width,height,model_height) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "...\venv\Lib\site-packages\easyocr\utils.py", line 576, in compute_ratio_and_resize img = cv2.resize(img,(int(model_height*ratio),model_height),interpolation=Image.ANTIALIAS)