Spaces:
Runtime error
Runtime error
Download app.py from ethancoen/docker-OCR: direct link, hf CLI and curl.
- Browser
- Download file 520 Bytes
-
https://huggingface.co/spaces/ethancoen/docker-OCR/resolve/main/app.py
- Command line
-
hf download hf://spaces/ethancoen/docker-OCR/app.py
-
curl -L -o app.py https://huggingface.co/spaces/ethancoen/docker-OCR/resolve/main/app.py
520 Bytes
| import gradio as gr | |
| import pytesseract | |
| from PIL import Image | |
| def ocr_handwriting(image): | |
| custom_config = r'--oem 1 --psm 6 -l eng' | |
| text = pytesseract.image_to_string(image, config=custom_config) | |
| return text | |
| iface = gr.Interface( | |
| fn=ocr_handwriting, | |
| inputs=gr.Image(type="pil"), | |
| outputs="text", | |
| title="📝 Tesseract Handwriting OCR", | |
| description="Uses Tesseract with LSTM mode and line detection (PSM 6). Upload a handwritten note and extract text." | |
| ) | |
| iface.launch() | |