Spaces:
Sleeping
Sleeping
Update generic.py
Browse files- generic.py +2 -2
generic.py
CHANGED
@@ -117,8 +117,8 @@ def save_image_vis(image_file_path, question):
|
|
117 |
img = img * mask.cpu().data.numpy()
|
118 |
# img = Image.fromarray(np.uint8(img)).convert('RGB')
|
119 |
cv2.imwrite(
|
120 |
-
'lxmert/
|
121 |
-
img = Image.open('lxmert/
|
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)
|
|
|
117 |
img = img * mask.cpu().data.numpy()
|
118 |
# img = Image.fromarray(np.uint8(img)).convert('RGB')
|
119 |
cv2.imwrite(
|
120 |
+
'lxmert/experiments/paper/new.jpg', img)
|
121 |
+
img = Image.open('lxmert/experiments/paper/new.jpg')
|
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)
|