Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generate a multiple saliency map for different objects at once #3

Open
alaa-shubbak opened this issue Nov 10, 2022 · 3 comments
Open
Labels
help wanted Extra attention is needed

Comments

@alaa-shubbak
Copy link

Hello ,

I am interested to know how can i generate the saliency map for multiple object in one image.

I know how to find a saliency map only for one object in the image , but i don't know how to make that for multiple objects (either from same category or different categories) .

I noticed that you mentioned that you can do it on this repository , Can you help me please?

@RuoyuChen10
Copy link
Owner

Hello ,

I am interested to know how can i generate the saliency map for multiple object in one image.

I know how to find a saliency map only for one object in the image , but i don't know how to make that for multiple objects (either from same category or different categories) .

I noticed that you mentioned that you can do it on this repository , Can you help me please?

For D-RISE, since the feedback is global, the saliency map corresponding to an object should also be global, not in-box. You can refer the file drise-yolov3.ipynb.

target_box = np.array([354, 177, 390, 235])
target_box = target_box.astype(int)
saliency_map = generate_saliency_map(image,
                                     target_class_index=1,
                                     target_box=target_box,
                                     prob_thresh=0.5,
                                     grid_size=(16, 16),
                                     n_masks=1000)

image_with_bbox = image.copy()
cv2.rectangle(image_with_bbox, tuple(target_box[:2]), tuple(target_box[2:]),
              (0, 255, 0), 5)
plt.figure(figsize=(7, 7))
plt.imshow(image_with_bbox[:, :, ::-1])
plt.imshow(saliency_map, cmap='jet', alpha=0.5)
plt.axis('off')
plt.show()

you can use detector to detect multi boxes, and input these detection boxes into the calculation in turn.

@alaa-shubbak
Copy link
Author

thanks , I will try it.

@RuoyuChen10
Copy link
Owner

Hello ,

I am interested to know how can i generate the saliency map for multiple object in one image.

I know how to find a saliency map only for one object in the image , but i don't know how to make that for multiple objects (either from same category or different categories) .

I noticed that you mentioned that you can do it on this repository , Can you help me please?

I just release the Grad-CAM of Faster R-CNN, you can have a look, it may closer to what you describe.

@RuoyuChen10 RuoyuChen10 added the help wanted Extra attention is needed label Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants