Commit
•
4cfee44
1
Parent(s):
e268100
Deploy changes
Browse files- Face Problems.ipynb +0 -0
- app.py +19 -0
- export.pkl +3 -0
- forehead_wrinkles.jpg +0 -0
- harmonal_acne.jpg +0 -0
- oily_skin.jpg +0 -0
- requirements.txt.txt +2 -0
Face Problems.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|
app.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from fastai.vision.all import *
|
3 |
+
import skimage
|
4 |
+
|
5 |
+
learn = load_learner('export.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))}
|
12 |
+
|
13 |
+
title = "Face condition Analyzer"
|
14 |
+
description = "A face condition detector trained on the custom dataset with fastai. Created using Gradio and HuggingFace Spaces."
|
15 |
+
examples = ['harmonal_acne.jpg','forehead_wrinkles.jpg','oily_skin.jpg']
|
16 |
+
enable_queue=True
|
17 |
+
|
18 |
+
gr.Interface(fn=predict,inputs=gr.inputs.Image(shape=(512, 512)),outputs=gr.outputs.Label(num_top_classes=3),title=title,
|
19 |
+
description=description,examples=examples,enable_queue=enable_queue).launch(share=True)
|
export.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:c11839d95c5c2725689d33b22c5b61fd2de4f24e5d225e4d5a02fa1b6b286273
|
3 |
+
size 103049429
|
forehead_wrinkles.jpg
ADDED
![]() |
harmonal_acne.jpg
ADDED
![]() |
oily_skin.jpg
ADDED
![]() |
requirements.txt.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
fastai
|
2 |
+
scikit-image
|