Spaces:
Runtime error
Runtime error
Commit
·
8e49105
1
Parent(s):
190ab79
let's deploy to huggingface spaces
Browse files- app.py +17 -0
- falcon-classifier +1 -0
- model.pkl +3 -0
- requirements.txt +1 -0
- saker.jpg +0 -0
- shaheen.jpg +0 -0
app.py
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from fastai.vision.all import *
|
2 |
+
|
3 |
+
learn = load_learner('model.pkl')
|
4 |
+
|
5 |
+
# labels = learn.dls.vocab
|
6 |
+
labels = ('Shaheen', 'Saker')
|
7 |
+
|
8 |
+
def predict(img):
|
9 |
+
img = PILImage.create(img)
|
10 |
+
pred,pred_idx,probs = learn.predict(img)
|
11 |
+
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
12 |
+
|
13 |
+
import gradio as gr
|
14 |
+
|
15 |
+
examples = ['shaheen.jpg', 'saker.jpg']
|
16 |
+
gr.Interface(fn=predict, inputs=gr.inputs.Image(shape=(512, 512)), outputs=gr.outputs.Label(num_top_classes=3), examples=examples).launch(share=True)
|
17 |
+
|
falcon-classifier
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
Subproject commit 3dae6cc4e25a807b9317ae810781155cb822e468
|
model.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:387189eabe2579df55b2d12e01557df41bf6e92815b433958d5b545dfe51e1fa
|
3 |
+
size 46953711
|
requirements.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
fastai
|
saker.jpg
ADDED
![]() |
shaheen.jpg
ADDED
![]() |