pytorch-grad-cam icon indicating copy to clipboard operation
pytorch-grad-cam copied to clipboard

Support for CLIP

Open Sidd1609 opened this issue 1 year ago • 6 comments

Hello, wanted to say that the repo is really well put and maintained! really appreciate everyone's effort.

I am currently trying to visualize concept activations on the image features using model = "ViT-L/14" for CLIP. I figured the target_layers but I am getting the issue where I need to also pass the text_features as:

ine 1501, in _call_impl return forward_call(*args, **kwargs) TypeError: forward() missing 1 required positional argument: 'text'

is there anyway of passing arguments to the forward call for the loaded model?

Thanks Regards -SriSiddarthC

Sidd1609 avatar Sep 24 '23 13:09 Sidd1609

Hi @Sidd1609 ,

You can create a wrapper around the model that will call it with the desired signature.

jacobgil avatar Oct 31 '23 05:10 jacobgil

Hello, wanted to say that the repo is really well put and maintained! really appreciate everyone's effort.

I am currently trying to visualize concept activations on the image features using model = "ViT-L/14" for CLIP. I figured the target_layers but I am getting the issue where I need to also pass the text_features as:

ine 1501, in _call_impl return forward_call(*args, **kwargs) TypeError: forward() missing 1 required positional argument: 'text'

is there anyway of passing arguments to the forward call for the loaded model?

Thanks Regards -SriSiddarthC

I also want to visualize the clip visual feature, do you slove it ?

FUIGUIMURONG avatar Nov 27 '23 05:11 FUIGUIMURONG

No not yet

On Mon, Nov 27, 2023 at 11:13 AM FUIGUIMURONG @.***> wrote:

Hello, wanted to say that the repo is really well put and maintained! really appreciate everyone's effort.

I am currently trying to visualize concept activations on the image features using model = "ViT-L/14" for CLIP. I figured the target_layers but I am getting the issue where I need to also pass the text_features as:

ine 1501, in _call_impl return forward_call(*args, **kwargs) TypeError: forward() missing 1 required positional argument: 'text'

is there anyway of passing arguments to the forward call for the loaded model?

Thanks Regards -SriSiddarthC

I also want to visualize the clip visual feature, do you slove it ?

— Reply to this email directly, view it on GitHub https://github.com/jacobgil/pytorch-grad-cam/issues/460#issuecomment-1827158101, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALTC7VZSWRNMUF32LLWH6HDYGQR7JAVCNFSM6AAAAAA5E6TJROVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRXGE2TQMJQGE . You are receiving this because you were mentioned.Message ID: @.***>

Sidd1609 avatar Nov 27 '23 05:11 Sidd1609

Hello, wanted to say that the repo is really well put and maintained! really appreciate everyone's effort.

I am currently trying to visualize concept activations on the image features using model = "ViT-L/14" for CLIP. I figured the target_layers but I am getting the issue where I need to also pass the text_features as:

ine 1501, in _call_impl return forward_call(*args, **kwargs) TypeError: forward() missing 1 required positional argument: 'text'

is there anyway of passing arguments to the forward call for the loaded model?

Thanks Regards -SriSiddarthC

Hello friend,do you think the "cam" is compatible with the visual encoder of CLIP?

Danny-1-8 avatar Dec 05 '23 02:12 Danny-1-8

@Sidd1609 @Danny-1-8 @FUIGUIMURONG were any of you able to get past the "TypeError: forward() missing 1 required positional argument: 'text'" and visualise the activations on the image?

Aashish75 avatar Apr 12 '24 15:04 Aashish75

I also want to visualize the clip visual feature.

zj56 avatar Aug 05 '24 16:08 zj56