Spaces:
Sleeping
Sleeping
Sharad Joshi
commited on
Commit
•
65144f7
1
Parent(s):
b4215e0
cleanup and adding examples
Browse files
1.png
ADDED
2.png
ADDED
3.png
ADDED
4.png
ADDED
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import gradio as gr
|
2 |
from fastai.vision.all import *
|
|
|
3 |
|
4 |
learn = load_learner('model.pkl')
|
5 |
|
@@ -8,6 +9,10 @@ def predict(img):
|
|
8 |
return round(learn.predict(img)[0][0])
|
9 |
|
10 |
title = "Number of characters in a single line image"
|
|
|
|
|
|
|
|
|
11 |
|
12 |
-
gr.Interface(fn=predict, inputs=gr.inputs.Image(), outputs=gr.outputs.Textbox(label='Predicted Score'), live=True).launch()
|
13 |
|
|
|
1 |
import gradio as gr
|
2 |
from fastai.vision.all import *
|
3 |
+
import scikit-image
|
4 |
|
5 |
learn = load_learner('model.pkl')
|
6 |
|
|
|
9 |
return round(learn.predict(img)[0][0])
|
10 |
|
11 |
title = "Number of characters in a single line image"
|
12 |
+
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."
|
13 |
+
examples = ["1.png", "2.png", "3.png", "4.png"]
|
14 |
+
interpretation = 'default'
|
15 |
+
enable_queue = True
|
16 |
|
17 |
+
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()
|
18 |
|