Spaces:
Sleeping
Sleeping
Muhammad Abdullahi
commited on
Commit
·
77f2493
1
Parent(s):
5ca8b68
added the main code and the model files
Browse files
app.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from fastai import load_learner
|
3 |
+
|
4 |
+
learner = load_learner('model.pkl')
|
5 |
+
|
6 |
+
def classify_images(img):
|
7 |
+
pred, index, probs = learner.predict(img)
|
8 |
+
return {learner.dls.vocab[i]: float(probs[i]) for i in range(len(learner.dls.vocab))}
|
9 |
+
|
10 |
+
intface = gr.Interface(fn=classify_images, inputs=gr.inputs.Image(type='pil'),
|
11 |
+
outputs=gr.outputs.Label(num_top_classes=2),
|
12 |
+
title="Kentish plover vs White-faced plover Classifier",
|
13 |
+
description="Upload an image of either Kentish plover and White-faced plover."
|
14 |
+
)
|
15 |
+
|
16 |
+
intface.launch(share=True)
|
model.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9d6f4100d6da6b22a3977d35e6aacea55f3fece76ebe06ec2aeb0ed85afea8a7
|
3 |
+
size 46969670
|