Spaces:
Sleeping
Sleeping
Update generic.py
Browse files- generic.py +2 -1
generic.py
CHANGED
@@ -122,7 +122,8 @@ def save_image_vis(image_file_path, question):
|
|
122 |
text_scores = (text_scores - text_scores.min()) / (text_scores.max() - text_scores.min())
|
123 |
vis_data_records = [visualization.VisualizationDataRecord(text_scores, 0, 0, 0, 0, 0, model_lrp.question_tokens, 1)]
|
124 |
html1 = visualization.visualize_text(vis_data_records)
|
125 |
-
|
|
|
126 |
|
127 |
|
128 |
|
|
|
122 |
text_scores = (text_scores - text_scores.min()) / (text_scores.max() - text_scores.min())
|
123 |
vis_data_records = [visualization.VisualizationDataRecord(text_scores, 0, 0, 0, 0, 0, model_lrp.question_tokens, 1)]
|
124 |
html1 = visualization.visualize_text(vis_data_records)
|
125 |
+
answer = vqa_answers[model_lrp.output.question_answering_score.argmax()]
|
126 |
+
return img, html1.data, answer
|
127 |
|
128 |
|
129 |
|