Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -49,7 +49,7 @@ emotion_emoji = {
|
|
49 |
|
50 |
# Image preprocessing
|
51 |
def emo_preprocess(image):
|
52 |
-
transform = transforms.Compose([
|
53 |
transforms.Resize(224),
|
54 |
transforms.CenterCrop(224),
|
55 |
transforms.ToTensor(),
|
@@ -73,8 +73,8 @@ def predict_emotion(image):
|
|
73 |
# Create Gradio interface
|
74 |
iface = gr.Interface(
|
75 |
fn=predict_emotion,
|
76 |
-
inputs=gr.
|
77 |
-
outputs=gr.
|
78 |
title="PerceptCLIP-Emotions",
|
79 |
description="This model predicts the emotion evoked by an image and returns the corresponding emoji along with the emotion name."
|
80 |
)
|
|
|
49 |
|
50 |
# Image preprocessing
|
51 |
def emo_preprocess(image):
|
52 |
+
transform = transforms.Compose([
|
53 |
transforms.Resize(224),
|
54 |
transforms.CenterCrop(224),
|
55 |
transforms.ToTensor(),
|
|
|
73 |
# Create Gradio interface
|
74 |
iface = gr.Interface(
|
75 |
fn=predict_emotion,
|
76 |
+
inputs=gr.Image(type="pil", label="Upload an Image"), # Updated line
|
77 |
+
outputs=gr.Textbox(label="Emotion + Emoji"), # Updated line
|
78 |
title="PerceptCLIP-Emotions",
|
79 |
description="This model predicts the emotion evoked by an image and returns the corresponding emoji along with the emotion name."
|
80 |
)
|