A collection of AIMv2 vision encoders that supports a number of resolutions, native resolution, and a distilled checkpoint. • 16 items • Updated • 83
Introduction
[AIMv2 Paper] [BibTeX]
We introduce the AIMv2 family of vision models pre-trained with a multimodal autoregressive objective. AIMv2 pre-training is simple and straightforward to train and scale effectively. Some AIMv2 highlights include:
- Outperforms OAI CLIP and SigLIP on the majority of multimodal understanding benchmarks.
- Outperforms DINOv2 on open-vocabulary object detection and referring expression comprehension.
- Exhibits strong recognition performance with AIMv2-3B achieving 89.5% on ImageNet using a frozen trunk.
Usage
PyTorch
import requests
from PIL import Image
from transformers import AutoImageProcessor, AutoModel
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)
processor = AutoImageProcessor.from_pretrained(
"apple/aimv2-3B-patch14-224",
revision="df1cbc288096c9742ec8bd6709ff82757972338c",
)
model = AutoModel.from_pretrained(
"apple/aimv2-3B-patch14-224",
revision="df1cbc288096c9742ec8bd6709ff82757972338c",
trust_remote_code=True,
)
inputs = processor(images=image, return_tensors="pt")
outputs = model(**inputs)
JAX
import requests
from PIL import Image
from transformers import AutoImageProcessor, FlaxAutoModel
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)
processor = AutoImageProcessor.from_pretrained(
"apple/aimv2-3B-patch14-224",
)
model = FlaxAutoModel.from_pretrained(
"apple/aimv2-3B-patch14-224",
trust_remote_code=True,
)
inputs = processor(images=image, return_tensors="jax")
outputs = model(**inputs)
Citation
If you find our work useful, please consider citing us as:
@misc{fini2024multimodalautoregressivepretraininglarge,
author = {Fini, Enrico and Shukor, Mustafa and Li, Xiujun and Dufter, Philipp and Klein, Michal and Haldimann, David and Aitharaju, Sai and da Costa, Victor Guilherme Turrisi and Béthune, Louis and Gan, Zhe and Toshev, Alexander T and Eichner, Marcin and Nabi, Moin and Yang, Yinfei and Susskind, Joshua M. and El-Nouby, Alaaeldin},
url = {https://arxiv.org/abs/2411.14402},
eprint = {2411.14402},
eprintclass = {cs.CV},
eprinttype = {arXiv},
title = {Multimodal Autoregressive Pre-training of Large Vision Encoders},
year = {2024},
}
- Downloads last month
- 206
Safetensors
Model size
3B params
Tensor type
F32
·
MLX
Hardware compatibility
Log In to add your hardware
Quantized
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support
Collection including apple/aimv2-3B-patch14-224
Paper for apple/aimv2-3B-patch14-224
Evaluation results
- Accuracy on imagenet-1kself-reported88.500
- Accuracy on inaturalist-18self-reported81.500
- Accuracy on cifar10self-reported99.500
- Accuracy on cifar100self-reported94.300
- Accuracy on food101self-reported96.800
- Accuracy on dtdself-reported88.900
- Accuracy on oxford-petsself-reported97.100
- Accuracy on stanford-carsself-reported96.500
