File size: 784 Bytes
062685f
 
7b0974c
062685f
 
 
 
 
 
 
 
65144f7
 
 
 
062685f
65144f7
062685f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import gradio as gr
from fastai.vision.all import *
import skimage

learn = load_learner('model.pkl')

def predict(img):
    img = PILImage.create(img)
    return round(learn.predict(img)[0][0])

title = "Number of characters in a single line image"
description = "Counts the number of characters including special characters in a text present in image. This is a precursor to building a different kind of OCR(experimental approach) with CNN + RNN."
examples = ["1.png", "2.png", "3.png", "4.png"]
interpretation = 'default'
enable_queue = True

gr.Interface(fn=predict, inputs=gr.inputs.Image(), outputs=gr.outputs.Textbox(label='Predicted Score'),title=title, description=description, examples=examples,interpretation=interpretation, enable_queue=enable_queue, live=True).launch()