Tesseract-OCR / app.py
tomofi's picture
Create app.py
75b9254
raw
history blame
711 Bytes
import os
import gradio as gr
def inference(filepath):
return os.popen(f'tesseract {filepath} -').read().strip()
title = "Tesseract OCR"
description = "Gradio demo for Tesseract. Tesseract is an open source text recognition (OCR) Engine."
article = "<p style='text-align: center'><a href='https://tesseract-ocr.github.io/' target='_blank'>Tesseract documentation</a> | <a href='https://github.com/tesseract-ocr/tesseract' target='_blank'>Github Repo</a></p>"
gr.Interface(
inference,
[gr.inputs.Image(type="filepath", label="Input")],
'text',
title=title,
description=description,
article=article,
examples=['eurotext.png']
).launch(enable_queue=True,cache_examples=True)