ZiqinZhou66 / ZegCLIP

Official implement of CVPR2023 ZegCLIP: Towards Adapting CLIP for Zero-shot Semantic Segmentation
MIT License
195 stars 17 forks source link

Possible bug: class_embedding is added twice in img_encoder #4

Open wizyoung opened 1 year ago

wizyoung commented 1 year ago

In https://github.com/ZiqinZhou66/ZegCLIP/blob/main/models/backbone/img_encoder.py#L231 of img_encoder.py, class_embedding is added twice. Is this a bug?

ZiqinZhou66 commented 1 year ago

Thanks for your interest in our work. We inherit the same forward function as DenseCLIP https://github.com/raoyongming/DenseCLIP/blob/3b72447dee3f622f3716738140161ef9f763c72f/segmentation/denseclip/models.py#L525. It seems a bug that the original code added the class_embedding twice. However, due to we apply the visual prompt tuning on encoder the final effect might be slightly.