sml2h3 / ocr_api_server

使用ddddocr的最简api搭建项目,支持docker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

759085503 opened this issue · comments

我使用docker部署完毕后使用ocr识别,api报错为{"status": 200, "result": "", "msg": "module 'PIL.Image' has no attribute 'ANTIALIAS'"}

请问是我哪里弄得不对吗

Pillow的10.0.0版本移除了ANTIALIAS,现在你只能使用PIL.Image.LANCZOS或者PIL.Image.Resampling.LANCZOS
解决方法:
输入命令docker exec -it <container id> /bin/bash进入容器,然后运行pip install Pillow==9.5.0,这样将Pillow版本退回到9.5.0版本,最后输入命令docker restart <container id>重启容器就好了。