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()