Spaces:
Runtime error
Runtime error
Download src/ocr_engine.py from jayanth-2005/output: direct link, hf CLI and curl.
- Browser
- Download file 273 Bytes
-
https://huggingface.co/spaces/jayanth-2005/output/resolve/main/src/ocr_engine.py
- Command line
-
hf download hf://spaces/jayanth-2005/output/src/ocr_engine.py
-
curl -L -o ocr_engine.py https://huggingface.co/spaces/jayanth-2005/output/resolve/main/src/ocr_engine.py
273 Bytes
| from paddleocr import PaddleOCR | |
| import numpy as np | |
| ocr = PaddleOCR(use_angle_cls=True, lang="en") | |
| def extract_text(image): | |
| result = ocr.ocr(image) | |
| text = "" | |
| for line in result: | |
| for word in line: | |
| text += word[1][0] + "\n" | |
| return text | |