Sharad Joshi commited on
Commit
062685f
1 Parent(s): 245c49d

let's deploy to huggingface spaces

Browse files
Files changed (3) hide show
  1. app.py +13 -0
  2. model.pkl +3 -0
  3. requirement.txt +1 -0
app.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from fastai.vision.all import *
3
+
4
+ learn = load_learner('model.pkl')
5
+
6
+ def predict(img):
7
+ img = PILImage.create(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')).launch(share=True)
13
+
model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2365973a0d415f77e4d6634963c33b4ee6457e610958c459ad3eff6a985d00de
3
+ size 87711065
requirement.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ fastai