๐ AIMv2 Vision Model
The AIMv2 family of vision models is pre - trained with a multimodal autoregressive objective, offering high - performance on various vision tasks.
๐ Quick Start
The AIMv2 family of vision models is pre - trained using a multimodal autoregressive objective. It's simple to train and scale effectively, and shows excellent performance on multiple multimodal understanding benchmarks.
โจ Features
- 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.
๐ฆ Installation
The document doesn't provide specific installation steps, so this section is skipped.
๐ป Usage Examples
Basic 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",
)
model = AutoModel.from_pretrained(
"apple/aimv2-3B-patch14-224",
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)
๐ Documentation
[AIMv2 Paper
] [BibTeX
]
๐ง Technical Details
Property |
Details |
Library Name |
transformers |
Model Type |
aimv2 - 3B - patch14 - 224 |
Metrics |
accuracy |
Pipeline Tag |
image - feature - extraction |
Tags |
vision, image - feature - extraction, mlx, pytorch |
License |
apple - amlr |
Model Performance
Task |
Dataset |
Accuracy |
Classification |
imagenet - 1k |
88.5 |
Classification |
inaturalist - 18 |
81.5 |
Classification |
cifar10 |
99.5 |
Classification |
cifar100 |
94.3 |
Classification |
food101 |
96.8 |
Classification |
dtd |
88.9 |
Classification |
oxford - pets |
97.1 |
Classification |
stanford - cars |
96.5 |
Classification |
camelyon17 |
93.5 |
Classification |
patch - camelyon |
89.4 |
Classification |
rxrx1 |
7.3 |
Classification |
eurosat |
99.0 |
Classification |
fmow |
64.2 |
Classification |
domainnet - infographic |
72.2 |
๐ License
The project uses the apple - amlr license.
๐ 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},
}