CLIPA-v2: Scaling CLIP Training with 81.1% Zero-shot ImageNet Accuracy within a $10,000 Budget; An Extra $4,000 Unlocks 81.8% Accuracy:
https://arxiv.org/abs/2306.15658
import torch
import torch.nn.functional as F
from urllib.request import urlopen
from PIL import Image
from open_clip import create_model_from_pretrained, get_tokenizer
model, preprocess = create_model_from_pretrained('hf-hub:ViT-H-14-CLIPA')
tokenizer = get_tokenizer('hf-hub:ViT-H-14-CLIPA')
image = Image.open(urlopen(
'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/beignets-task-guide.png'
))
image = preprocess(image).unsqueeze(0)
text = tokenizer(["a diagram", "a dog", "a cat", "a beignet"], context_length=model.context_length)
with torch.no_grad(), torch.cuda.amp.autocast():
image_features = model.encode_image(image)
text_features = model.encode_text(text)
image_features = F.normalize(image_features, dim=-1)
text_features = F.normalize(text_features, dim=-1)
text_probs = (100.0 * image_features @ text_features.T).softmax(dim=-1)
print("Label probs:", text_probs) # prints: [[0., 0., 0., 1.0]]
Citation
@article{li2023clipav2,
title={CLIPA-v2: Scaling CLIP Training with 81.1% Zero-shot ImageNet Accuracy within a $10,000 Budget; An Extra $4,000 Unlocks 81.8% Accuracy},
author={Xianhang Li and Zeyu Wang and Cihang Xie},
journal={arXiv preprint arXiv:2306.15658},
year={2023},
}
@inproceedings{li2023clipa,
title={An Inverse Scaling Law for CLIP Training},
author={Xianhang Li and Zeyu Wang and Cihang Xie},
booktitle={NeurIPS},
year={2023},
}
Runs of UCSC-VLAA ViT-H-14-CLIPA-datacomp1B on huggingface.co
357
Total runs
0
24-hour runs
-4
3-day runs
-170
7-day runs
-18
30-day runs
More Information About ViT-H-14-CLIPA-datacomp1B huggingface.co Model
More ViT-H-14-CLIPA-datacomp1B license Visit here:
ViT-H-14-CLIPA-datacomp1B huggingface.co is an AI model on huggingface.co that provides ViT-H-14-CLIPA-datacomp1B's model effect (), which can be used instantly with this UCSC-VLAA ViT-H-14-CLIPA-datacomp1B model. huggingface.co supports a free trial of the ViT-H-14-CLIPA-datacomp1B model, and also provides paid use of the ViT-H-14-CLIPA-datacomp1B. Support call ViT-H-14-CLIPA-datacomp1B model through api, including Node.js, Python, http.
ViT-H-14-CLIPA-datacomp1B huggingface.co is an online trial and call api platform, which integrates ViT-H-14-CLIPA-datacomp1B's modeling effects, including api services, and provides a free online trial of ViT-H-14-CLIPA-datacomp1B, you can try ViT-H-14-CLIPA-datacomp1B online for free by clicking the link below.
UCSC-VLAA ViT-H-14-CLIPA-datacomp1B online free url in huggingface.co:
ViT-H-14-CLIPA-datacomp1B is an open source model from GitHub that offers a free installation service, and any user can find ViT-H-14-CLIPA-datacomp1B on GitHub to install. At the same time, huggingface.co provides the effect of ViT-H-14-CLIPA-datacomp1B install, users can directly use ViT-H-14-CLIPA-datacomp1B installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
ViT-H-14-CLIPA-datacomp1B install url in huggingface.co: