Spaces:
Sleeping
Sleeping
adelinamart
commited on
Commit
•
b99bfa0
1
Parent(s):
bbc083a
Update app.py
Browse files
app.py
CHANGED
@@ -3,13 +3,13 @@ from transformers import pipeline
|
|
3 |
|
4 |
pipeline = pipeline(task="text-classification", model="adelinamart/minilm_finetuned_emotions")
|
5 |
|
6 |
-
def predict(
|
7 |
-
predictions = pipeline(
|
8 |
-
return
|
9 |
|
10 |
gradio_app = gr.Interface(
|
11 |
predict,
|
12 |
-
inputs=gr.Image(label="Select
|
13 |
outputs=[gr.Image(label="Processed Image"), gr.Label(label="Result", num_top_classes=6)],
|
14 |
title="Happy? Or Not?",
|
15 |
)
|
|
|
3 |
|
4 |
pipeline = pipeline(task="text-classification", model="adelinamart/minilm_finetuned_emotions")
|
5 |
|
6 |
+
def predict(input):
|
7 |
+
predictions = pipeline(input)
|
8 |
+
return input, {p["label"]: p["score"] for p in predictions}
|
9 |
|
10 |
gradio_app = gr.Interface(
|
11 |
predict,
|
12 |
+
inputs=gr.Image(label="Select info", sources=['upload', 'webcam'], type="pil"),
|
13 |
outputs=[gr.Image(label="Processed Image"), gr.Label(label="Result", num_top_classes=6)],
|
14 |
title="Happy? Or Not?",
|
15 |
)
|