Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -533,8 +533,8 @@ async def scan2OCR(request):
|
|
533 |
# out = pytesseract.image_to_string(f"{file_id}.png", lang="vie", config=r'--psm 4')
|
534 |
# os.remove(f"{file_id}.png")
|
535 |
_loop = asyncio.get_running_loop()
|
536 |
-
|
537 |
-
|
538 |
# adapt the output text to the HTML-based rich text editor
|
539 |
ret.append({"content": out.replace('\n','<br/>')})
|
540 |
|
|
|
533 |
# out = pytesseract.image_to_string(f"{file_id}.png", lang="vie", config=r'--psm 4')
|
534 |
# os.remove(f"{file_id}.png")
|
535 |
_loop = asyncio.get_running_loop()
|
536 |
+
_out = await _loop.run_in_executor(None, partial(__ocr, im, file_id))
|
537 |
+
out = await _out
|
538 |
# adapt the output text to the HTML-based rich text editor
|
539 |
ret.append({"content": out.replace('\n','<br/>')})
|
540 |
|