import os import gradio as gr def inference(filepath): return os.popen(f'djpeg {filepath} | gocr -').read().strip() title = "GOCR" description = "Gradio demo for GOCR. GOCR is an OCR (Optical Character Recognition) program, developed under the GNU Public License. It converts scanned images of text back to text files." article = "

GOCR

" gr.Interface( inference, [gr.inputs.Image(type="filepath", label="Input")], 'text', title=title, description=description, article=article, examples=['handwrt1.jpg'] ).launch(enable_queue=True,cache_examples=True)