VikParuchuri / surya

OCR, layout analysis, reading order, table recognition in 90+ languages
https://www.datalab.to
GNU General Public License v3.0
14.35k stars 899 forks source link

surya_gui report an error #197

Open luxi001-aaa opened 1 month ago

luxi001-aaa commented 1 month ago

TypeError: unsupported operand type(s) for |: '_GenericAlias' and 'NoneType' Traceback: File "E:\Users\admin\anaconda3\envs\paddle_ocr\lib\site-packages\streamlit\runtime\scriptrunner\exec_code.py", line 88, in exec_func_with_error_handling result = func() File "E:\Users\admin\anaconda3\envs\paddle_ocr\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 579, in code_to_exec exec(code, module.dict) File "E:\Users\admin\anaconda3\envs\paddle_ocr\Lib\site-packages\ocr_app.py", line 6, in from surya.detection import batch_text_detection File "E:\Users\admin\anaconda3\envs\paddle_ocr\lib\site-packages\surya\detection.py", line 8, in from surya.postprocessing.heatmap import get_and_clean_boxes File "E:\Users\admin\anaconda3\envs\paddle_ocr\lib\site-packages\surya\postprocessing\heatmap.py", line 10, in from surya.schema import PolygonBox File "E:\Users\admin\anaconda3\envs\paddle_ocr\lib\site-packages\surya\schema.py", line 141, in class OCRResult(BaseModel): File "E:\Users\admin\anaconda3\envs\paddle_ocr\lib\site-packages\surya\schema.py", line 143, in OCRResult languages: List[str] | None = None

luxi001-aaa commented 1 month ago

Python 3.9.20

wssam-hassan commented 1 month ago

@fcy0011

This issue happens because of python version less than 3.10. If you used any python 3.10 or higher this issue will disappear.

FabricioTeran commented 1 month ago

Update your readme.md, it says that python 3.9+ is supported

wade0426 commented 1 month ago

I'm also experiencing this issue with 3.9.19, as I see documentation that says it supports 3.9+.

katie312 commented 1 month ago

@fcy0011

This issue happens because of python version less than 3.10.出现此问题是因为 python 版本低于 3.10。 If you used any python 3.10 or higher this issue will disappear.如果您使用任何python 3.10 或更高版本,此问题将会消失。

hi, I've been using python3.10.13, I have came across this problem too