Spaces:
Sleeping
Sleeping
Sungmin Son
commited on
Commit
·
9e4a9cf
1
Parent(s):
7575b43
delete unnecessary files
Browse files- Untitled-1.ipynb +12 -12
- app.py/app/py.py +0 -30
- app/app/py.py +0 -30
Untitled-1.ipynb
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
"cells": [
|
| 3 |
{
|
| 4 |
"cell_type": "code",
|
| 5 |
-
"execution_count":
|
| 6 |
"metadata": {},
|
| 7 |
"outputs": [],
|
| 8 |
"source": [
|
|
@@ -15,7 +15,7 @@
|
|
| 15 |
},
|
| 16 |
{
|
| 17 |
"cell_type": "code",
|
| 18 |
-
"execution_count":
|
| 19 |
"metadata": {},
|
| 20 |
"outputs": [],
|
| 21 |
"source": [
|
|
@@ -26,7 +26,7 @@
|
|
| 26 |
},
|
| 27 |
{
|
| 28 |
"cell_type": "code",
|
| 29 |
-
"execution_count":
|
| 30 |
"metadata": {},
|
| 31 |
"outputs": [],
|
| 32 |
"source": [
|
|
@@ -37,7 +37,7 @@
|
|
| 37 |
},
|
| 38 |
{
|
| 39 |
"cell_type": "code",
|
| 40 |
-
"execution_count":
|
| 41 |
"metadata": {},
|
| 42 |
"outputs": [
|
| 43 |
{
|
|
@@ -83,7 +83,7 @@
|
|
| 83 |
"('False', tensor(0), tensor([9.9983e-01, 1.6505e-04]))"
|
| 84 |
]
|
| 85 |
},
|
| 86 |
-
"execution_count":
|
| 87 |
"metadata": {},
|
| 88 |
"output_type": "execute_result"
|
| 89 |
}
|
|
@@ -96,7 +96,7 @@
|
|
| 96 |
},
|
| 97 |
{
|
| 98 |
"cell_type": "code",
|
| 99 |
-
"execution_count":
|
| 100 |
"metadata": {},
|
| 101 |
"outputs": [],
|
| 102 |
"source": [
|
|
@@ -110,7 +110,7 @@
|
|
| 110 |
},
|
| 111 |
{
|
| 112 |
"cell_type": "code",
|
| 113 |
-
"execution_count":
|
| 114 |
"metadata": {},
|
| 115 |
"outputs": [
|
| 116 |
{
|
|
@@ -156,7 +156,7 @@
|
|
| 156 |
"{'dog': 0.9998348951339722, 'cat': 0.00016504859377164394}"
|
| 157 |
]
|
| 158 |
},
|
| 159 |
-
"execution_count":
|
| 160 |
"metadata": {},
|
| 161 |
"output_type": "execute_result"
|
| 162 |
}
|
|
@@ -167,7 +167,7 @@
|
|
| 167 |
},
|
| 168 |
{
|
| 169 |
"cell_type": "code",
|
| 170 |
-
"execution_count":
|
| 171 |
"metadata": {},
|
| 172 |
"outputs": [
|
| 173 |
{
|
|
@@ -195,7 +195,7 @@
|
|
| 195 |
"data": {
|
| 196 |
"text/plain": []
|
| 197 |
},
|
| 198 |
-
"execution_count":
|
| 199 |
"metadata": {},
|
| 200 |
"output_type": "execute_result"
|
| 201 |
}
|
|
@@ -213,12 +213,12 @@
|
|
| 213 |
},
|
| 214 |
{
|
| 215 |
"cell_type": "code",
|
| 216 |
-
"execution_count":
|
| 217 |
"metadata": {},
|
| 218 |
"outputs": [],
|
| 219 |
"source": [
|
| 220 |
"import nbdev\n",
|
| 221 |
-
"nbdev.export.nb_export('Untitled-1.ipynb'
|
| 222 |
]
|
| 223 |
}
|
| 224 |
],
|
|
|
|
| 2 |
"cells": [
|
| 3 |
{
|
| 4 |
"cell_type": "code",
|
| 5 |
+
"execution_count": 1,
|
| 6 |
"metadata": {},
|
| 7 |
"outputs": [],
|
| 8 |
"source": [
|
|
|
|
| 15 |
},
|
| 16 |
{
|
| 17 |
"cell_type": "code",
|
| 18 |
+
"execution_count": 2,
|
| 19 |
"metadata": {},
|
| 20 |
"outputs": [],
|
| 21 |
"source": [
|
|
|
|
| 26 |
},
|
| 27 |
{
|
| 28 |
"cell_type": "code",
|
| 29 |
+
"execution_count": 3,
|
| 30 |
"metadata": {},
|
| 31 |
"outputs": [],
|
| 32 |
"source": [
|
|
|
|
| 37 |
},
|
| 38 |
{
|
| 39 |
"cell_type": "code",
|
| 40 |
+
"execution_count": 4,
|
| 41 |
"metadata": {},
|
| 42 |
"outputs": [
|
| 43 |
{
|
|
|
|
| 83 |
"('False', tensor(0), tensor([9.9983e-01, 1.6505e-04]))"
|
| 84 |
]
|
| 85 |
},
|
| 86 |
+
"execution_count": 4,
|
| 87 |
"metadata": {},
|
| 88 |
"output_type": "execute_result"
|
| 89 |
}
|
|
|
|
| 96 |
},
|
| 97 |
{
|
| 98 |
"cell_type": "code",
|
| 99 |
+
"execution_count": 5,
|
| 100 |
"metadata": {},
|
| 101 |
"outputs": [],
|
| 102 |
"source": [
|
|
|
|
| 110 |
},
|
| 111 |
{
|
| 112 |
"cell_type": "code",
|
| 113 |
+
"execution_count": 6,
|
| 114 |
"metadata": {},
|
| 115 |
"outputs": [
|
| 116 |
{
|
|
|
|
| 156 |
"{'dog': 0.9998348951339722, 'cat': 0.00016504859377164394}"
|
| 157 |
]
|
| 158 |
},
|
| 159 |
+
"execution_count": 6,
|
| 160 |
"metadata": {},
|
| 161 |
"output_type": "execute_result"
|
| 162 |
}
|
|
|
|
| 167 |
},
|
| 168 |
{
|
| 169 |
"cell_type": "code",
|
| 170 |
+
"execution_count": 7,
|
| 171 |
"metadata": {},
|
| 172 |
"outputs": [
|
| 173 |
{
|
|
|
|
| 195 |
"data": {
|
| 196 |
"text/plain": []
|
| 197 |
},
|
| 198 |
+
"execution_count": 7,
|
| 199 |
"metadata": {},
|
| 200 |
"output_type": "execute_result"
|
| 201 |
}
|
|
|
|
| 213 |
},
|
| 214 |
{
|
| 215 |
"cell_type": "code",
|
| 216 |
+
"execution_count": 8,
|
| 217 |
"metadata": {},
|
| 218 |
"outputs": [],
|
| 219 |
"source": [
|
| 220 |
"import nbdev\n",
|
| 221 |
+
"nbdev.export.nb_export('Untitled-1.ipynb')"
|
| 222 |
]
|
| 223 |
}
|
| 224 |
],
|
app.py/app/py.py
DELETED
|
@@ -1,30 +0,0 @@
|
|
| 1 |
-
# AUTOGENERATED! DO NOT EDIT! File to edit: ../../Untitled-1.ipynb.
|
| 2 |
-
|
| 3 |
-
# %% auto 0
|
| 4 |
-
__all__ = ['model_path', 'learn', 'categories', 'is_cat', 'classify_image']
|
| 5 |
-
|
| 6 |
-
# %% ../../Untitled-1.ipynb 0
|
| 7 |
-
import gradio as gr
|
| 8 |
-
from fastai.vision.all import *
|
| 9 |
-
def is_cat(x): return x[0].isupper()
|
| 10 |
-
|
| 11 |
-
# %% ../../Untitled-1.ipynb 2
|
| 12 |
-
model_path = Path('model.pkl')
|
| 13 |
-
learn = load_learner(model_path)
|
| 14 |
-
|
| 15 |
-
# %% ../../Untitled-1.ipynb 4
|
| 16 |
-
categories = ('dog', 'cat')
|
| 17 |
-
|
| 18 |
-
def classify_image(img):
|
| 19 |
-
pred,idx,probs = learn.predict(img)
|
| 20 |
-
return dict(zip(categories, map(float,probs)))
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
# %% ../../Untitled-1.ipynb 6
|
| 24 |
-
gr.Interface(fn = classify_image,
|
| 25 |
-
inputs="image",
|
| 26 |
-
outputs="label",
|
| 27 |
-
title = "Dog or Cat",
|
| 28 |
-
description="Sample workflow",
|
| 29 |
-
examples = ['dog.jpg']
|
| 30 |
-
).launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/app/py.py
DELETED
|
@@ -1,30 +0,0 @@
|
|
| 1 |
-
# AUTOGENERATED! DO NOT EDIT! File to edit: ../../Untitled-1.ipynb.
|
| 2 |
-
|
| 3 |
-
# %% auto 0
|
| 4 |
-
__all__ = ['model_path', 'learn', 'categories', 'is_cat', 'classify_image']
|
| 5 |
-
|
| 6 |
-
# %% ../../Untitled-1.ipynb 0
|
| 7 |
-
import gradio as gr
|
| 8 |
-
from fastai.vision.all import *
|
| 9 |
-
def is_cat(x): return x[0].isupper()
|
| 10 |
-
|
| 11 |
-
# %% ../../Untitled-1.ipynb 2
|
| 12 |
-
model_path = Path('model.pkl')
|
| 13 |
-
learn = load_learner(model_path)
|
| 14 |
-
|
| 15 |
-
# %% ../../Untitled-1.ipynb 4
|
| 16 |
-
categories = ('dog', 'cat')
|
| 17 |
-
|
| 18 |
-
def classify_image(img):
|
| 19 |
-
pred,idx,probs = learn.predict(img)
|
| 20 |
-
return dict(zip(categories, map(float,probs)))
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
# %% ../../Untitled-1.ipynb 6
|
| 24 |
-
gr.Interface(fn = classify_image,
|
| 25 |
-
inputs="image",
|
| 26 |
-
outputs="label",
|
| 27 |
-
title = "Dog or Cat",
|
| 28 |
-
description="Sample workflow",
|
| 29 |
-
examples = ['dog.jpg']
|
| 30 |
-
).launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|