Spaces:
Build error
Build error
Upload 10 files
Browse files- .gitattributes +1 -0
- app.py +20 -0
- hotornot.pk1 +3 -0
- img01.jpg +0 -0
- img02.jpg +0 -0
- img03.jpg +0 -0
- img04.jpg +0 -0
- img05.jpg +0 -0
- img06.jpg +0 -0
- img07.jpeg +0 -0
- requirements.txt +2 -0
.gitattributes
CHANGED
@@ -32,3 +32,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
32 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
33 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
34 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
32 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
33 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
34 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
35 |
+
hotornot.pk1 filter=lfs diff=lfs merge=lfs -text
|
app.py
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
__all__ = ['learner_faces', 'categories', 'classify_faces', 'image', 'label', 'examples', 'intf']
|
2 |
+
|
3 |
+
from fastai.vision.all import *
|
4 |
+
import gradio as gr
|
5 |
+
|
6 |
+
|
7 |
+
learner_attractiveness = load_learner('hotornot.pk1')
|
8 |
+
categories = ['hot', 'average', 'ugly']
|
9 |
+
|
10 |
+
def classify_attractiveness(img):
|
11 |
+
prediction, index, probability = learner_attractiveness.predict(img)
|
12 |
+
return dict(zip(categories, map(float, probability)))
|
13 |
+
|
14 |
+
intf = gr.Interface(fn=classify_faces,
|
15 |
+
inputs=gr.Image(shape=(192, 192)),
|
16 |
+
outputs=gr.Label(),
|
17 |
+
examples=[])
|
18 |
+
intf.launch(inline=False)
|
19 |
+
|
20 |
+
|
hotornot.pk1
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9142733a0527311aab8819b96163f3a8a8c2bbe982b17815aa0cc6501d39a4ec
|
3 |
+
size 102923477
|
img01.jpg
ADDED
img02.jpg
ADDED
img03.jpg
ADDED
img04.jpg
ADDED
img05.jpg
ADDED
img06.jpg
ADDED
img07.jpeg
ADDED
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
fastai
|
2 |
+
gradio
|