nedcpr commited on
Commit
c96d8a1
1 Parent(s): f92ef77

add trailing files

Browse files
.ipynb_checkpoints/README-checkpoint.md ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: Digit_classifier
3
+ emoji: 🦀
4
+ colorFrom: pink
5
+ colorTo: pink
6
+ sdk: gradio
7
+ sdk_version: 2.9.4
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#reference
.ipynb_checkpoints/app-checkpoint.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from fastai.vision.all import *
3
+ import skimage
4
+
5
+ learn = load_learner('model.pkl')
6
+
7
+ categories = ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9')
8
+
9
+ def classify_image(img):
10
+ pred,idx,probs = learn.predict(img)
11
+ return dict(zip(categories, map(float,probs)))
12
+
13
+ image = gr.inputs.Image(shape=(100,100))
14
+ label = gr.outputs.Label()
15
+ title = "Sign Language Digit Classifier"
16
+ description = "A sign language digit classifier trained on a Kaggle dataset with fast.ai. Click on an example (6, 7, and 8) or upload an image and let the model classify it for you!"
17
+ interpretation='default'
18
+ examples= ['3.JPG', '7.JPG', '8.JPG']
19
+ enable_queue=True
20
+
21
+ gr.Interface(fn=classify_image,inputs=gr.inputs.Image(shape=(100, 100)),outputs=gr.outputs.Label(num_top_classes=3),title=title,description=description,examples=examples).launch()