Open Faiail opened 7 months ago
Hello, I have tried to use the clip notebook, but concering the word importance, no configuration has never output some negative importance.
I attach a sample code snipped:
img_path = "CLIP/glasses.png" img = preprocess(Image.open(img_path)).unsqueeze(0).to(device) texts = ["a bear"] text = clip.tokenize(texts).to(device) R_text, R_image = interpret(model=model, image=img, texts=text, device=device) batch_size = text.shape[0] for i in range(batch_size): show_heatmap_on_text(texts[i], text[i], R_text[i]) show_image_relevance(R_image[i], img, orig_image=Image.open(img_path)) plt.show()
The output is the following:
Thanks for the help :)
Hello, I have tried to use the clip notebook, but concering the word importance, no configuration has never output some negative importance.
I attach a sample code snipped:
The output is the following:
Thanks for the help :)