Model reference · open weights
EVA-CLIP is an open-weight embedding model from BAAI. 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
| Released by | BAAI |
|---|---|
| Type | Embedding models |
| Task | Embeddings |
| Context | 77 tokens |
| Runs with | transformers |
| Released | 2024-02-05 |
| Popularity | 1k downloads / month |
| Licence | Open weights |
About
Quan Sun1*, Jinsheng Wang1*, Qiying Yu1,2*, Yufeng Cui1, Fan Zhang1, Xiaosong Zhang1, Xinlong Wang1
Scaling up contrastive language-image pretraining (CLIP) is critical for empowering both vision and multimodal models. We present EVA-CLIP-18B, the largest and most powerful open-source CLIP model to date, with 18-billion parameters. With only 6-billion training samples seen, EVA-CLIP-18B achieves an exceptional 80.7% zero-shot top-1 accuracy averaged across 27 widely recognized image classification benchmarks, outperforming its forerunner EVA-CLIP (5-billion parameters) and other open-source CLIP models by a large margin. Remarkably, we observe a consistent performance improvement with the model size scaling of EVA-CLIP, despite maintaining a constant training dataset of 2-billion image-text pairs from LAION-2B and COYO-700M. This dataset is openly available and much smaller than the in-house datasets (e.g., DFN-5B, WebLI-10B) employed in other state-of-the-art CLIP models. EVA-CLIP-18B demonstrates the potential of EVA-style weak-to-strong visual model scaling. With our model weights made publicly available, we hope to facilitate future research in vision and multimodal foundation models.
Table of Contents
Scaling behavior of EVA-CLIP with zero-shot classification performance averaged across 27 image classification benchmarks, compared with the current state-of-the-art and largest CLIP models (224px). The diameter of each circle demonstrates the forward GFLOPs × the number of training samples seen. The performance of EVA-CLIP consistently improves as scaling up.
| model name | total #params | seen samples | pytorch weight |
|---|---|---|---|
EVA_8B_psz14 | 7.5B | 6B | PT (31.0GB) |
Image encoder MIM teacher: EVA02_CLIP_E_psz14_plus_s9B.
| model name | image enc. init. ckpt | text enc. init. ckpt | total #params | training data | training batch size | gpus for training | img. cls. avg. acc. | video cls. avg. acc. | retrieval MR | hf weight | pytorch weight |
|---|---|---|---|---|---|---|---|---|---|---|---|
EVA-CLIP-8B | EVA_8B_psz14 | EVA02_CLIP_E_psz14_plus_s9B | 8.1B | Merged-2B | 178K | 384 A100(40GB) | 79.4 | 73.6 | 86.2 | 🤗 HF | PT (32.9GB) |
EVA-CLIP-8B-448 | EVA-CLIP-8B | EVA-CLIP-8B | 8.1B | Merged-2B | 24K | 384 A100(40GB) | 80.0 | 73.7 | 86.4 | 🤗 HF | PT (32.9GB) |
Image encoder MIM teacher: EVA02_CLIP_E_psz14_plus_s9B.
| model name | image enc. init. ckpt | text enc. init. ckpt | total #params | training data | training batch size | gpus for training | img. cls. avg. acc. | video cls. avg. acc. | retrieval MR | hf weight | pytorch weight |
|---|---|---|---|---|---|---|---|---|---|---|---|
EVA-CLIP-18B | EVA_18B_psz14 | EVA02_CLIP_E_psz14_plus_s9B | 18.1B | Merged-2B+ | 108K | 360 A100(40GB) | 80.7 | 75.0 | 87.8 | stay tuned | stay tuned |
It's important to note that all results presented in the paper are evaluated using PyTorch weights. There may be differences in performance when using Hugging Face (hf) models.
We use CLIP-Benchmark to evaluate the zero-shot performance of EVA-CLIP models. Following vissl, we evauate the zero-shot video classification using 1 middle frame. Further details regarding the evaluation datasets can be found in our paper, particularly in Table 11.
from PIL import Image
from transformers import AutoModel, AutoConfig
from transformers import CLIPImageProcessor, pipeline, CLIPTokenizer
import torch
import torchvision.transforms as T
from torchvision.transforms import InterpolationMode
image_path = "CLIP.png"
model_name_or_path = "BAAI/EVA-CLIP-8B" # or /path/to/local/EVA-CLIP-8B
image_size = 224
processor = CLIPImageProcessor.from_pretrained("openai/clip-vit-large-patch14")
#From the published model card. Full card on the HuggingFace links in the sidebar.
Using it via the API
Once AxForge deploys eva-clip for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (eva-clip 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":"eva-clip","input":"text to embed"}'
Create an account — your API key is available in the console. 3M free tokens every 30 days with every new account.