Streamlit_OCR_comparator Not Up and Running!?

#2
by apathak123 - opened

The Loren/Streamlit_OCR_comparator is not working! Please have it up. :)

it's due to a mmocr installation bug, I'm going to modify the app by removing the mmocr part.

mmocr removed, the app encounters this error:
terminate called after throwing an instance of ‘std::runtime_error’
what(): instance allocation failed: new instance has no pybind11-registered base types
Waiting for response on the forum
https://discuss.huggingface.co/t/instance-allocation-failed-new-instance-has-no-pybind11/53833

Thanks Loren!
The UI comes up, I am able to upload a file, but when I click the "Launch" button, I still get the following error, related to PaddleOCR:

===============
FileNotFoundError: [Errno 2] No such file or directory: '/home/user/.paddleocr/whl/det/en/en_PP-OCRv3_det_infer/en_PP-OCRv3_det_infer.tar'
Traceback:
File "/home/user/.local/lib/python3.10/site-packages/streamlit/scriptrunner/script_runner.py", line 554, in _run_script
exec(code, module.dict)
File "/home/user/app/Home.py", line 17, in
app.run()
File "/home/user/app/multipage.py", line 67, in run
self.pages[index]"function"
File "/home/user/app/app_pages/ocr_comparator.py", line 1173, in app
list_readers = init_readers(list_params_det)
File "/home/user/app/app_pages/ocr_comparator.py", line 258, in init_readers
reader_ppocr = init_ppocr(in_list_params[1])
File "/home/user/.local/lib/python3.10/site-packages/streamlit/legacy_caching/caching.py", line 575, in wrapped_func
return get_or_create_cached_value()
File "/home/user/.local/lib/python3.10/site-packages/streamlit/legacy_caching/caching.py", line 557, in get_or_create_cached_value
return_value = func(*args, **kwargs)
File "/home/user/app/app_pages/ocr_comparator.py", line 223, in init_ppocr
out_ocr = PaddleOCR(lang=in_params[0], **in_params[1])
File "/home/user/.local/lib/python3.10/site-packages/paddleocr/paddleocr.py", line 599, in init
maybe_download(params.det_model_dir, det_url)
File "/home/user/.local/lib/python3.10/site-packages/paddleocr/ppocr/utils/network.py", line 56, in maybe_download
with tarfile.open(tmp_path, 'r') as tarObj:
File "/usr/local/lib/python3.10/tarfile.py", line 1804, in open
return func(name, "r", fileobj, **kwargs)
File "/usr/local/lib/python3.10/tarfile.py", line 1870, in gzopen
fileobj = GzipFile(name, mode + "b", compresslevel, fileobj)
File "/usr/local/lib/python3.10/gzip.py", line 174, in init
fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')

Another issue, now the application launch is not working. It's been over 30 minutes that I have been getting the following message:

Readers initializations in progress (it may take a while) ...

PPOCR reader initialization in progress ...
StreamlitOCR_Demo.PNG

Problem solved!
The application is now available again.

Loren changed discussion status to closed

Sign up or log in to comment