A CLIP (Contrastive Language-Image Pre-training) model trained on DFN-2B.
Data Filtering Networks (DFNs) are small networks used to automatically filter large pools of uncurated data.
This model was trained on 2B images that were filtered from a pool of 12.8B uncurated image-text pairs
(12.8B image-text pairs from CommonPool-12.8B).
This model has been converted to PyTorch from the original JAX checkpoints from Axlearn (
https://github.com/apple/axlearn
).
These weights are directly usable in OpenCLIP (image + text).
Model Details
Model Type:
Contrastive Image-Text, Zero-Shot Image Classification.
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:apple/DFN2B-CLIP-ViT-L-14')
tokenizer = get_tokenizer('ViT-L-14')
image = Image.open(urlopen(
'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/beignets-task-guide.png'
))
image = preprocess(image).unsqueeze(0)
labels_list = ["a dog", "a cat", "a donut", "a beignet"]
text = tokenizer(labels_list, 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 = torch.sigmoid(image_features @ text_features.T * model.logit_scale.exp() + model.logit_bias)
zipped_list = list(zip(labels_list, [round(p.item(), 3) for p in text_probs[0]]))
print("Label probabilities: ", zipped_list)
Citation
@article{fang2023data,
title={Data Filtering Networks},
author={Fang, Alex and Jose, Albin Madappally and Jain, Amit and Schmidt, Ludwig and Toshev, Alexander and Shankar, Vaishaal},
journal={arXiv preprint arXiv:2309.17425},
year={2023}
}
Runs of apple DFN2B-CLIP-ViT-L-14 on huggingface.co
29.3K
Total runs
-86
24-hour runs
1.7K
3-day runs
8.0K
7-day runs
21.6K
30-day runs
More Information About DFN2B-CLIP-ViT-L-14 huggingface.co Model
DFN2B-CLIP-ViT-L-14 huggingface.co is an AI model on huggingface.co that provides DFN2B-CLIP-ViT-L-14's model effect (), which can be used instantly with this apple DFN2B-CLIP-ViT-L-14 model. huggingface.co supports a free trial of the DFN2B-CLIP-ViT-L-14 model, and also provides paid use of the DFN2B-CLIP-ViT-L-14. Support call DFN2B-CLIP-ViT-L-14 model through api, including Node.js, Python, http.
DFN2B-CLIP-ViT-L-14 huggingface.co is an online trial and call api platform, which integrates DFN2B-CLIP-ViT-L-14's modeling effects, including api services, and provides a free online trial of DFN2B-CLIP-ViT-L-14, you can try DFN2B-CLIP-ViT-L-14 online for free by clicking the link below.
apple DFN2B-CLIP-ViT-L-14 online free url in huggingface.co:
DFN2B-CLIP-ViT-L-14 is an open source model from GitHub that offers a free installation service, and any user can find DFN2B-CLIP-ViT-L-14 on GitHub to install. At the same time, huggingface.co provides the effect of DFN2B-CLIP-ViT-L-14 install, users can directly use DFN2B-CLIP-ViT-L-14 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
DFN2B-CLIP-ViT-L-14 install url in huggingface.co: