TotalUpbeat commited on
Commit
32b6255
·
1 Parent(s): d1c58df

Update app.py to work

Browse files
Files changed (1) hide show
  1. app.py +3 -11
app.py CHANGED
@@ -1,13 +1,5 @@
1
  import gradio as gr
2
- from transformers import AutoFeatureExtractor, AutoModelForImageClassification
3
 
4
-
5
- extractor = AutoFeatureExtractor.from_pretrained("Rajaram1996/FacialEmoRecog")
6
-
7
- model = AutoModelForImageClassification.from_pretrained("Rajaram1996/FacialEmoRecog")
8
-
9
- def greet(name):
10
- return "Hello " + name + "!!"
11
-
12
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
13
- iface.launch()
 
1
  import gradio as gr
2
+ from transformers import pipeline
3
 
4
+ pipe = pipeline(task="image-classification", model="Rajaram1996/FacialEmoRecog")
5
+ gr.Interface.from_pipeline(pipe, title="Emotion Recognition using facial expressions", examples = ["Sample 1.jpg", "Sample 2.jpg",], allow_flagging="never").launch(inbrowswer=True)