Spaces:
Sleeping
Sleeping
upload
Browse files- Panhtera_tigris.jpg +0 -0
- Panhtera_uncia.jpg +0 -0
- app.py +19 -0
- model.pkl +3 -0
Panhtera_tigris.jpg
ADDED
Panhtera_uncia.jpg
ADDED
app.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import fastai
|
2 |
+
from fastai.vision.all import *
|
3 |
+
import pathlib
|
4 |
+
plt = platform.system()
|
5 |
+
if plt == 'Linux': pathlib.WindowsPath = pathlib.PosixPath
|
6 |
+
import gradio as gr
|
7 |
+
def Panther_Identifier(x): return x[0].isupper()
|
8 |
+
|
9 |
+
learn = load_learner('model.pkl')
|
10 |
+
categories = ('Leão','Onça-pintada','Leopardo','Tigre','Leopardo-das-neves')
|
11 |
+
def classify_image(img):
|
12 |
+
pred,idx,probs = learn.predict(img)
|
13 |
+
return dict(zip(categories,map(float,probs)))
|
14 |
+
|
15 |
+
image=gr.inputs.Image(shape=(192,192))
|
16 |
+
label=gr.outputs.Label()
|
17 |
+
examples=['Panhtera_tigris.jpg','Panhtera_uncia.jpg']
|
18 |
+
intf=gr.Interface(fn=classify_image,inputs=image,outputs=label, examples=examples)
|
19 |
+
intf.launch(inline=False)
|
model.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a0479c12f21da58bccbfcbf6fdfec18eea5b84e9c8e8fdb81b8b65f194e832c4
|
3 |
+
size 46979281
|