import os import gradio as gr def inference(filepath): return os.popen(f'ssocr -D-1 -t 70 {filepath}').read().strip() title = "Seven Segment Optical Character Recognition" description = "Gradio demo for SSOCR. Seven Segment Optical Character Recognition or ssocr for short is a program to recognize digits of a seven segment display. An image of one row of digits is used for input and the recognized number is written to the standard output." article = "

SSOCR | Github Repo

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