File size: 905 Bytes
a2d6790
 
 
 
0d6a678
a2d6790
 
9406ee5
a2d6790
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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 = "<p style='text-align: center'><a href='https://www.unix-ag.uni-kl.de/~auerswal/ssocr/' target='_blank'>SSOCR</a> | <a href='https://github.com/auerswal/ssocr' target='_blank'>Github Repo</a></p>"
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)