xmed-lab / CLIP_Surgery

CLIP Surgery for Better Explainability with Enhancement in Open-Vocabulary Tasks
358 stars 24 forks source link

[feature proposal] #9

Closed Yupjun closed 1 year ago

Yupjun commented 1 year ago

image

As you know, tensor activations tend to act noisy on unseen input image. So for the clarity of segmentation, it would be better if you use masking based on tensor values. Please check on Pull requests

Eli-YiLi commented 1 year ago

Thanks for your interest on our work. Yes, it deepens on users to add a threshold. Besides, torch.clamp is also able to achieve your goal. Also, cv2.threshold(similarity_map, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU) can choose auto threshold for your need.