mirror of
https://github.com/openai/CLIP.git
synced 2026-11-05 01:37:26 +00:00
[GH-ISSUE #162] Questions about the spatial features of vision encoder in CLIP #140
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
openai/CLIP#140
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Wuziyi616 on GitHub (Oct 22, 2021).
Original GitHub issue: https://github.com/openai/CLIP/issues/162
Thank you so much for opening source such great work! I'm currently thinking of adopting CLIP to some language-guided dense prediction vision task. Logically I think only using the global feature vector from the
class_embeddingfrom ViT (taking onlyx = self.ln_post(x[:, 0, :])) won't work well, because dense prediction task requires local features. So I'm thinking of instead of taking the global feature, I can actually takex[:, 1:, :], these features will somehow retain some spatial correspondence with the position in the image. But if I understand correctly, CLIP is trained only using contrastive loss between global vision feature and text feature. So I'm not sure if the remaining patch features are also well-trained/meaningful... Can you give me some insight in it? Or I wonder if there are some works studying/using these spatial features? Thanks in advance.@jongwook commented on GitHub (Oct 22, 2021):
Examples in #82 show it's somewhat possible to use the spatial features, and it'd be interesting to try fine-tuning an object detector from it. We haven't tested against any detection benchmarks.
@Wuziyi616 commented on GitHub (Oct 22, 2021):
Thank you so much for your prompt reply. One another question, just to make sure, the feature that CLIP paper used for downstream task (e.g. classification) is this line right (that's before linear projection)? So if I take the features of all the patches, I don't need to worry about this projection operation.
@jongwook commented on GitHub (Oct 22, 2021):
yes, you can change that line to use
[:, 1:, :]instead. For the downstream tasks we skipped the projection layer (by settingmodel.proj = None) and replaced with task-specific heads.@Wuziyi616 commented on GitHub (Oct 22, 2021):
Thanks! That helps me a lot.