Amitz244 commited on
Commit
eed280f
·
verified ·
1 Parent(s): bd52cb4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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.inputs.Image(type="pil", label="Upload an Image"),
77
- outputs=gr.outputs.Textbox(label="Emotion + Emoji"),
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
  )