๐ AIMv2 Vision Models
This repository introduces the AIMv2 family of vision models. These models are pre - trained with a multimodal autoregressive objective, offering simplicity in pre - training, easy scalability, and outstanding performance in various multimodal and vision - related tasks.
๐ Quick Start
The AIMv2 models can be used for image feature extraction. You can use them with either PyTorch or JAX.
โจ Features
- Multimodal Benchmark Performance: Outperforms OAI CLIP and SigLIP on the majority of multimodal understanding benchmarks.
- Object Detection and Comprehension: Outperforms DINOv2 on open - vocabulary object detection and referring expression comprehension.
- Strong Recognition Ability: AIMv2 - 3B achieves 89.5% on ImageNet using a frozen trunk.
๐ฆ Installation
The installation process is mainly related to the transformers
library. You can install it via pip
:
pip install transformers
๐ป 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-large-patch14-224-distilled",
)
model = AutoModel.from_pretrained(
"apple/aimv2-large-patch14-224-distilled",
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-large-patch14-224-distilled",
)
model = FlaxAutoModel.from_pretrained(
"apple/aimv2-large-patch14-224-distilled",
trust_remote_code=True,
)
inputs = processor(images=image, return_tensors="jax")
outputs = model(**inputs)
๐ Documentation
[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.
๐ 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},
}
Additional Information
Property |
Details |
Model Type |
Vision models pre - trained with a multimodal autoregressive objective |
Training Data |
Not specified |
Metrics |
accuracy |
Pipeline Tag |
image - feature - extraction |
Tags |
vision, image - feature - extraction, mlx, pytorch |