Spaces:
Sleeping
Sleeping
prairie-guy
commited on
Commit
•
c605cb7
1
Parent(s):
07dc94e
Deploy Art_Mood
Browse files- _Image10.jpg +3 -0
- _Image11.jpg +3 -0
- _Image12.jpg +3 -0
- _Image5.jpg +3 -0
- _Image6.jpg +3 -0
- _Image7.jpg +3 -0
- _Image8.jpg +3 -0
- _Image9.jpg +3 -0
- app.py +18 -0
- export.pkl +3 -0
- requirements.txt +2 -0
_Image10.jpg
ADDED
Git LFS Details
|
_Image11.jpg
ADDED
Git LFS Details
|
_Image12.jpg
ADDED
Git LFS Details
|
_Image5.jpg
ADDED
Git LFS Details
|
_Image6.jpg
ADDED
Git LFS Details
|
_Image7.jpg
ADDED
Git LFS Details
|
_Image8.jpg
ADDED
Git LFS Details
|
_Image9.jpg
ADDED
Git LFS Details
|
app.py
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from fastai.vision.all import *
|
3 |
+
import skimage
|
4 |
+
|
5 |
+
learn = load_learner('export.pkl')
|
6 |
+
|
7 |
+
def predict(img):
|
8 |
+
labels = learn.dls.vocab
|
9 |
+
im = PILImage.create(img)
|
10 |
+
pred,pred_idx,probs = learn.predict(im)
|
11 |
+
return {label: float(prob) for (label,prob) in zip(labels,probs)}
|
12 |
+
|
13 |
+
gr.Interface(fn=predict,
|
14 |
+
inputs=gr.inputs.Image(shape=((400,400))),
|
15 |
+
outputs=gr.outputs.Label(num_top_classes=4),
|
16 |
+
title = "Art Mood",
|
17 |
+
examples = [f'_Image{i}.jpg' for i in range(5,12)],
|
18 |
+
description= "What is the Mood of the Art? Spring, Summer, Winter or Fall?").launch(share=True, enable_queue=True)
|
export.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:399c9a23aab84157a48c5468caec1bb1e9e574ab580c5bd8cccec375840e5cb4
|
3 |
+
size 102931549
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
fastai
|
2 |
+
scikit-image
|