muneebashraf commited on
Commit
c0f01b6
·
1 Parent(s): 6e0fe78
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -29,13 +29,14 @@ def generate_caption_and_analyze_emotions(image):
29
  # Get the predicted emotion label
30
  emotion_label = emotion_tokenizer.decode(emotion_outputs.logits.argmax())
31
 
 
32
  # Prepare the final output with sentiment information
33
- final_output = f"The sentiment in the provided image shows: {emotion_label}.\n\nGenerated Caption: {decoded_caption}"
34
- return final_output
35
 
36
  # Define the Gradio interface
37
  inputs = gr.inputs.Image(label="Upload an image")
38
- outputs = gr.outputs.Textbox(label="Generated Caption and Sentiment Analysis")
39
 
40
  # Create the Gradio app
41
  gr.Interface(fn=generate_caption_and_analyze_emotions, inputs=inputs, outputs=outputs).launch()
 
29
  # Get the predicted emotion label
30
  emotion_label = emotion_tokenizer.decode(emotion_outputs.logits.argmax())
31
 
32
+
33
  # Prepare the final output with sentiment information
34
+ #final_output = f"The sentiment in the provided image shows: {emotion_label}.\n\nGenerated Caption: {decoded_caption}"
35
+ return emotion_label
36
 
37
  # Define the Gradio interface
38
  inputs = gr.inputs.Image(label="Upload an image")
39
+ outputs = gr.outputs.Textbox(label="Generated Sentiment")
40
 
41
  # Create the Gradio app
42
  gr.Interface(fn=generate_caption_and_analyze_emotions, inputs=inputs, outputs=outputs).launch()