Edit model card

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:

  1. Outperforms OAI CLIP and SigLIP on the majority of multimodal understanding benchmarks.
  2. Outperforms DINOv2 on open-vocabulary object detection and referring expression comprehension.
  3. Exhibits strong recognition performance with AIMv2-3B achieving 89.5% on ImageNet using a frozen trunk.
AIMv2 Overview

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-huge-patch14-448",
)
model = AutoModel.from_pretrained(
    "apple/aimv2-huge-patch14-448",
    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-huge-patch14-448",
)
model = FlaxAutoModel.from_pretrained(
    "apple/aimv2-huge-patch14-448",
    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{fini2024multimodal,
  title         = {Multimodal Autoregressive Pre-training of Large Vision Encoders},
  author        = {Enrico Fini and Mustafa Shukor and Xiujun Li and Philipp Dufter and Michal Klein and David Haldimann and Sai Aitharaju and Victor Guilherme Turrisi da Costa and Louis Béthune and Zhe Gan and Alexander T Toshev and Marcin Eichner and Moin Nabi and Yinfei Yang and Joshua M. Susskind and Alaaeldin El-Nouby},
  year          = {2024},
  archivePrefix = {arXiv},
  primaryClass  = {cs.CV},
}
Downloads last month
0
Safetensors
Model size
682M params
Tensor type
F32
·
Inference API
Inference API (serverless) does not yet support model repos that contain custom code.

Collection including apple/aimv2-huge-patch14-448

Evaluation results