Model reference · open weights
clip-V-B-16 is an open-weight embedding model from sentence-transformers. AxForge deploys and operates it for you on dedicated EU-owned hardware — with the licence handled where one is required.
Available as managed deployment — configured and operated for you on dedicated EU hardware, quoted per deployment.
What it is
| Maker | sentence-transformers |
|---|---|
| Type | Embedding models |
| Task | Embeddings |
| Runs with | sentence-transformers |
| Released | 2022-04-12 |
| Popularity | 0 downloads / month |
| Licence | Unknown |
About
This is the Image & Text model CLIP, which maps text and images to a shared vector space. For applications of the models, have a look in our documentation SBERT.net - Image Search
After installing sentence-transformers (pip install sentence-transformers), the usage of this model is easy:
from sentence_transformers import SentenceTransformer, util
from PIL import Image
#Load CLIP model
model = SentenceTransformer('clip-ViT-B-16')
#Encode an image:
img_emb = model.encode(Image.open('two_dogs_in_snow.jpg'))
#Encode text descriptions
text_emb = model.encode(['Two dogs in the snow', 'A cat on a table', 'A picture of London at night'])
#Compute cosine similarities
cos_scores = util.cos_sim(img_emb, text_emb)
print(cos_scores)
See our SBERT.net - Image Search documentation for more examples how the model can be used for image search, zero-shot image classification, image clustering and image deduplication.
In the following table we find the zero-shot ImageNet validation set accuracy:
| Model | Top 1 Performance |
|---|---|
| clip-ViT-B-32 | 63.3 |
| clip-ViT-B-16 | 68.1 |
| clip-ViT-L-14 | 75.4 |
For a multilingual version of the CLIP model for 50+ languages have a look at: clip-ViT-B-32-multilingual-v1
From the published model card. Full card on the HuggingFace links in the sidebar.
How it works
Using it via the API
Once AxForge deploys clip-v-b-16 for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (clip-v-b-16 below is illustrative; you get the exact model name on deployment.)
$ curl -sS https://api.axforge.ai/v1/embeddings \
-H "Authorization: Bearer $AXFORGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"clip-v-b-16","input":"text to embed"}'
Create an account — your API key is available in the console. 5M tokens/month currently included with every new account at launch.