mlfoundations / open_clip

An open source implementation of CLIP.
Other
9.93k stars 959 forks source link

Code for zero-shot classification with CoCa #768

Closed shivam-chandhok closed 9 months ago

shivam-chandhok commented 9 months ago

Hi, Can you provide a short code to do zero-shot classification (based on cosine similarity similar to CLIP ) with CoCa model.??

gabrielilharco commented 9 months ago

CoCa models can also contrast images and text, so you can use them in the same way you use other CLIP models for zero-shot classification. CLIP benchmark (https://github.com/LAION-AI/CLIP_benchmark#how-to-use) has support for many common datasets in case you are interested