Spaces:
Runtime error
Runtime error
CalvHobbes
commited on
Commit
•
fe07070
1
Parent(s):
0973397
my model
Browse files- .gitignore +1 -0
- .ipynb_checkpoints/testing-checkpoint.ipynb +20 -0
- app.py +19 -4
- karakoram.jpg +0 -0
- requirements.txt +3 -0
- topmountainsmodel.pkl +3 -0
.gitignore
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
testing.ipynb
|
.ipynb_checkpoints/testing-checkpoint.ipynb
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "code",
|
5 |
+
"execution_count": null,
|
6 |
+
"metadata": {},
|
7 |
+
"outputs": [],
|
8 |
+
"source": [
|
9 |
+
"from fastai.vision.all import *"
|
10 |
+
]
|
11 |
+
}
|
12 |
+
],
|
13 |
+
"metadata": {
|
14 |
+
"language_info": {
|
15 |
+
"name": "python"
|
16 |
+
}
|
17 |
+
},
|
18 |
+
"nbformat": 4,
|
19 |
+
"nbformat_minor": 2
|
20 |
+
}
|
app.py
CHANGED
@@ -1,7 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
2 |
|
3 |
-
def
|
4 |
-
|
|
|
|
|
5 |
|
6 |
-
iface = gr.Interface(fn=
|
7 |
-
iface.launch()
|
|
|
|
1 |
+
# import gradio as gr
|
2 |
+
|
3 |
+
# def greet(name):
|
4 |
+
# return "Hello " + name + "!!"
|
5 |
+
|
6 |
+
# iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
7 |
+
# iface.launch()
|
8 |
+
|
9 |
import gradio as gr
|
10 |
+
from fastai.vision.all import *
|
11 |
+
import skimage
|
12 |
+
|
13 |
+
learn = load_learner("topmountainsmodel.pkl")
|
14 |
|
15 |
+
def predict(img):
|
16 |
+
img = PILImage.create(img)
|
17 |
+
mt_type,_,probs = learn.predict(img)
|
18 |
+
return mt_type
|
19 |
|
20 |
+
iface = gr.Interface(fn=predict, inputs="image", outputs="label")
|
21 |
+
iface.launch()
|
22 |
+
|
karakoram.jpg
ADDED
requirements.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
fastai
|
2 |
+
scikit-image
|
3 |
+
gradio
|
topmountainsmodel.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4f22271bee6c340cb62b1d99399181b7c425f1a02cf7d3ad3594048dd794ee26
|
3 |
+
size 47004333
|