changes
Browse files
Octopus.jpg
ADDED
Squid.jpg
ADDED
app.py
CHANGED
@@ -1,7 +1,15 @@
|
|
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
-
|
4 |
-
|
|
|
|
|
|
|
5 |
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
1 |
+
from fastai.vision.all import *
|
2 |
import gradio as gr
|
3 |
+
def Octopus_or_Squid(x): return x[0].isupper()
|
4 |
|
5 |
+
learn = load_learner('model.pkl')
|
6 |
+
categories = ('Octopus','Squid')
|
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=(192,192))
|
12 |
+
label=gr.outputs.Label()
|
13 |
+
examples=['Octopus.jpg','Squid.jpg']
|
14 |
+
intf=gr.Interface(fn=classify_image,inputs=image,outputs=label, examples=examples)
|
15 |
+
intf.launch(inline=False)
|
model.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b9924f7bf04bfd587c89c6c418c95a94d827c07cf18380d72463016cc5e23562
|
3 |
+
size 46954777
|