Spaces:
Sleeping
Sleeping
Tomas Ellis
commited on
Commit
·
2275664
1
Parent(s):
316b03c
add auto notebook parser
Browse files
.ipynb_checkpoints/app-checkpoint.ipynb
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [],
|
3 |
+
"metadata": {},
|
4 |
+
"nbformat": 4,
|
5 |
+
"nbformat_minor": 5
|
6 |
+
}
|
.ipynb_checkpoints/saving-a-basic-fastai-model-checkpoint.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|
app copy.py
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from fastai.vision.all import *
|
2 |
+
import gradio as gr
|
3 |
+
|
4 |
+
learn = load_learner('catornot_model.pkl')
|
5 |
+
|
6 |
+
categories = ('Dog', 'Cat')
|
7 |
+
|
8 |
+
def classify_image(img):
|
9 |
+
pred, idx, probs = learn.predict(img)
|
10 |
+
return dict(zip(categories, map(float, probs)))
|
11 |
+
|
12 |
+
image = gr.inputs.Image(shape=(192, 192))
|
13 |
+
label = gr.outputs.Label()
|
14 |
+
examples = ['dog.jpg', 'cat.jpg', 'dunno.jpg']
|
15 |
+
|
16 |
+
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
|
17 |
+
intf.launch(inline=False)
|
app.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|
app.py
CHANGED
@@ -1,17 +1,22 @@
|
|
1 |
-
|
2 |
-
import gradio as gr
|
3 |
|
|
|
|
|
|
|
|
|
4 |
learn = load_learner('catornot_model.pkl')
|
5 |
|
|
|
6 |
categories = ('Dog', 'Cat')
|
7 |
|
8 |
def classify_image(img):
|
9 |
-
pred,
|
10 |
-
return dict(zip(categories, map(float,
|
11 |
|
12 |
-
|
13 |
-
|
|
|
14 |
examples = ['dog.jpg', 'cat.jpg', 'dunno.jpg']
|
15 |
|
16 |
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
|
17 |
-
intf.launch(
|
|
|
1 |
+
# AUTOGENERATED! DO NOT EDIT! File to edit: app.ipynb.
|
|
|
2 |
|
3 |
+
# %% auto 0
|
4 |
+
__all__ = ['learn', 'categories', 'image', 'label', 'examples', 'intf', 'classify_image']
|
5 |
+
|
6 |
+
# %% app.ipynb 2
|
7 |
learn = load_learner('catornot_model.pkl')
|
8 |
|
9 |
+
# %% app.ipynb 5
|
10 |
categories = ('Dog', 'Cat')
|
11 |
|
12 |
def classify_image(img):
|
13 |
+
pred,idx,probs = learn.predict(img)
|
14 |
+
return dict(zip(categories, map(float,probs)))
|
15 |
|
16 |
+
# %% app.ipynb 7
|
17 |
+
image = gr.Image(shape=(192,192))
|
18 |
+
label = gr.Label()
|
19 |
examples = ['dog.jpg', 'cat.jpg', 'dunno.jpg']
|
20 |
|
21 |
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
|
22 |
+
intf.launch()
|
saving-a-basic-fastai-model.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|
saving-a-basic-fastai-model.ipynb:Zone.Identifier
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
[ZoneTransfer]
|
2 |
+
ZoneId=3
|
3 |
+
HostUrl=about:internet
|