Spaces:
Runtime error
Runtime error
(SangYeop) commited on
Commit ·
fd01946
1
Parent(s): 94df62b
commit
Browse files- .gitignore +0 -0
- FullHair.jpg +3 -0
- app.py +18 -0
- bald_detector.ipynb +0 -0
- hair_loss_head.jpg +3 -0
- model.pkl +3 -0
- teamjang.jpg +3 -0
.gitignore
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
FullHair.jpg
ADDED
|
Git LFS Details
|
app.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from fastai.vision.all import *
|
| 2 |
+
import gradio as gr
|
| 3 |
+
|
| 4 |
+
def is_balding(x): return x[0].isupper()
|
| 5 |
+
|
| 6 |
+
learn = load_learner('model.pkl')
|
| 7 |
+
categories = ('Balding', 'Full Hair')
|
| 8 |
+
|
| 9 |
+
def classify_image(img):
|
| 10 |
+
pred, idx, probs = learn.predict(img)
|
| 11 |
+
return dict(zip(categories, map(float, probs)))
|
| 12 |
+
|
| 13 |
+
image = gr.Image()
|
| 14 |
+
label = gr.Label()
|
| 15 |
+
examples = ['hair_loss_head.jpg', 'FullHair.jpg', 'teamjang.jpg']
|
| 16 |
+
|
| 17 |
+
intf = gr.Interface(fn= classify_image, inputs= image, outputs= label, examples= examples)
|
| 18 |
+
intf.launch(inline=False)
|
bald_detector.ipynb
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
hair_loss_head.jpg
ADDED
|
Git LFS Details
|
model.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:27e53b866485f8151415958ca1e5a43eac68ecfb7fbd1732588c477744d8698a
|
| 3 |
+
size 46961214
|
teamjang.jpg
ADDED
|
Git LFS Details
|