Commit
·
bbb184e
1
Parent(s):
de04e86
commit
Browse files
app.py
CHANGED
|
@@ -29,6 +29,10 @@ 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
|
|
|
|
| 29 |
# Get the predicted emotion label
|
| 30 |
emotion_label = emotion_tokenizer.decode(emotion_outputs.logits.argmax())
|
| 31 |
|
| 32 |
+
# Debug print for caption and emotion label
|
| 33 |
+
print("Generated Caption:", decoded_caption)
|
| 34 |
+
print("Predicted Emotion Label:", emotion_label)
|
| 35 |
+
|
| 36 |
# Prepare the final output with sentiment information
|
| 37 |
final_output = f"The sentiment in the provided image shows: {emotion_label}.\n\nGenerated Caption: {decoded_caption}"
|
| 38 |
return final_output
|