Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,17 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
-
|
4 |
-
return "Hello " + name + "!!"
|
5 |
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
|
4 |
+
from transformers import AutoFeatureExtractor, AutoModelForImageClassification
|
|
|
5 |
|
6 |
+
extractor = AutoFeatureExtractor.from_pretrained("kdhht2334/autotrain-diffusion-emotion-facial-expression-recognition-40429105176")
|
7 |
+
fer_model = AutoModelForImageClassification.from_pretrained("kdhht2334/autotrain-diffusion-emotion-facial-expression-recognition-40429105176")
|
8 |
+
|
9 |
+
pipe = pipeline(task="image-classification",
|
10 |
+
# model that can do 7-emotion classification
|
11 |
+
model=fer_model)
|
12 |
+
gr.Interface.from_pipeline(pipe,
|
13 |
+
title="7-emotion classification in DiffusionFER dataset",
|
14 |
+
description="Facial expression recognition trained with Transformer,
|
15 |
+
examples = ['happy.png', 'angry.png',],
|
16 |
+
article = "Author: <a href=\"https://huggingface.co/FER-Universe\">Daeha Kim</a>",
|
17 |
+
).launch()
|