ahadjawaid
commited on
Commit
•
0560d50
1
Parent(s):
15dff63
inital commit
Browse files- model.pkl +3 -0
- monkey-classifer.py +20 -0
- requirements.txt +5 -0
model.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:83e5e041f686171106bb1365a2209670b153b321f905fea10fe8a910a086ab50
|
3 |
+
size 46966605
|
monkey-classifer.py
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from fastai.vision.all import *
|
2 |
+
import gradio as gr
|
3 |
+
|
4 |
+
learn = load_learner("model.pkl")
|
5 |
+
|
6 |
+
categories = ["Bald uakari monkey", "Mandrill monkey",
|
7 |
+
"Panamanian White-faced Capuchin monkey",
|
8 |
+
"Golden snub-nosed monkey",
|
9 |
+
"Black howler monkey", "Guinea baboon",
|
10 |
+
"Bonnet macaque", "Japanese macaque"]
|
11 |
+
|
12 |
+
def classify_image(image):
|
13 |
+
pred, i, prob = learn.predict(image)
|
14 |
+
return dict(zip(categories, map(float, prob)))
|
15 |
+
|
16 |
+
image = gr.inputs.Image(shape=(192, 192))
|
17 |
+
label = gr.outputs.Label()
|
18 |
+
|
19 |
+
interface = gr.Interface(fn=classify_image, inputs=image, outputs=label)
|
20 |
+
interface.launch(inline=False)
|
requirements.txt
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
duckduckgo-search==2.8.5
|
2 |
+
torch
|
3 |
+
fastai
|
4 |
+
notebook
|
5 |
+
gradio
|