File size: 520 Bytes
2a9d993
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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()