Spaces:
Runtime error
Runtime error
Rebolforces
commited on
Commit
•
690886e
1
Parent(s):
f6952ca
init commit
Browse files- app.py +11 -0
- matsumoto.jpg +0 -0
- nagoya.jpg +0 -0
- okayama.jpg +0 -0
- osaka.jpg +0 -0
- requirements.txt +2 -0
- shimabara.jpg +0 -0
app.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from fastai.vision.all import *
|
3 |
+
import skimage
|
4 |
+
|
5 |
+
learn = load_learner('export-castles.pkl')
|
6 |
+
|
7 |
+
labels = learn.dls.vocab
|
8 |
+
def predict(img):
|
9 |
+
img = PILImage.create(img)
|
10 |
+
pred,pred_idx,probs = learn.predict(img)
|
11 |
+
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
matsumoto.jpg
ADDED
nagoya.jpg
ADDED
okayama.jpg
ADDED
osaka.jpg
ADDED
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
fastai
|
2 |
+
scikit-image
|
shimabara.jpg
ADDED