Download ocr_engine.py from Rakib023/ID_INFO: direct link, hf CLI and curl.
- Browser
- Download file 252 Bytes
-
https://huggingface.co/spaces/Rakib023/ID_INFO/resolve/main/ocr_engine.py
- Command line
-
hf download hf://spaces/Rakib023/ID_INFO/ocr_engine.py
-
curl -L -o ocr_engine.py https://huggingface.co/spaces/Rakib023/ID_INFO/resolve/main/ocr_engine.py
252 Bytes
| import easyocr | |
| import streamlit as st | |
| def load_ocr(): | |
| return easyocr.Reader(['en'], gpu=False) | |
| def extract_text(image): | |
| reader = load_ocr() | |
| results = reader.readtext(image) | |
| return " | ".join([r[1] for r in results]) | |