henriquemcruz commited on
Commit
5d4f954
β€’
1 Parent(s): 9cf1b5a
Files changed (7) hide show
  1. Numbers.png +0 -0
  2. README.md +13 -0
  3. Rows.png +0 -0
  4. Sheets.png +0 -0
  5. app.py +16 -0
  6. model.pkl +3 -0
  7. requirements.txt +5 -0
Numbers.png ADDED
README.md ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: Spreadsheetclassifier
3
+ emoji: πŸ“‰
4
+ colorFrom: pink
5
+ colorTo: indigo
6
+ sdk: gradio
7
+ sdk_version: 3.1.7
8
+ app_file: app.py
9
+ pinned: false
10
+ license: apache-2.0
11
+ ---
12
+
13
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
Rows.png ADDED
Sheets.png ADDED
app.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastai.vision.all import *
2
+ import gradio as gr
3
+ learn = load_learner('model.pkl')
4
+
5
+ categories = ('Rows','Sheets','Numbers','Excel')
6
+
7
+ def classify_image(img):
8
+ pred,idx,probs = learn.predict(img)
9
+ return dict(zip(categories,map(float,probs)))
10
+
11
+ image = gr.inputs.Image(shape=(400,400))
12
+ label = gr.outputs.Label()
13
+ examples = ['Rows.png','Sheets.png','Numbers.png']
14
+
15
+ intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
16
+ intf.launch(inline=False)
model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:561d5739384000ff331432a5741944598b92bf11c0e0cbc65f28b8c46456aa26
3
+ size 46963433
requirements.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ fastai
2
+ torch
3
+ gradio
4
+ numpy
5
+ pandas