kdhht2334 commited on
Commit
f5fc913
1 Parent(s): db81938

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -4
app.py CHANGED
@@ -1,7 +1,17 @@
1
  import gradio as gr
 
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
5
 
6
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- iface.launch()
 
 
 
 
 
 
 
 
 
 
 
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()