🚀 圖像特徵提取模型transformers
本項目引入了基於多模態自迴歸目標預訓練的AIMv2系列視覺模型。AIMv2預訓練簡單直接,能夠有效進行訓練和擴展。該模型在多個多模態理解基準測試中表現出色,在開放詞彙目標檢測和指代表達理解等任務上也有優秀的表現。
🚀 快速開始
本項目提供了transformers
庫,可用於圖像特徵提取。下面是使用該庫的基本步驟。
✨ 主要特性
- 在大多數多模態理解基準測試中,性能優於OAI CLIP和SigLIP。
- 在開放詞彙目標檢測和指代表達理解任務上,性能優於DINOv2。
- 具有強大的識別性能,AIMv2 - 3B在使用凍結主幹的情況下,在ImageNet上達到了89.5%的準確率。
📦 安裝指南
文檔未提供具體安裝步驟,可參考transformers
庫的官方文檔進行安裝。
💻 使用示例
基礎用法
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-1B-patch14-448",
)
model = AutoModel.from_pretrained(
"apple/aimv2-1B-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-1B-patch14-448",
)
model = FlaxAutoModel.from_pretrained(
"apple/aimv2-1B-patch14-448",
trust_remote_code=True,
)
inputs = processor(images=image, return_tensors="jax")
outputs = model(**inputs)
📚 詳細文檔
模型信息
屬性 |
詳情 |
庫名稱 |
transformers |
許可證 |
apple - amlr |
評估指標 |
accuracy |
任務類型 |
image - feature - extraction |
標籤 |
vision、image - feature - extraction、mlx、pytorch |
模型名稱 |
aimv2 - 1B - patch14 - 448 |
模型在不同數據集上的分類準確率
數據集名稱 |
數據集類型 |
準確率 |
是否驗證 |
imagenet - 1k |
imagenet - 1k |
89.0 |
false |
inaturalist - 18 |
inaturalist - 18 |
83.8 |
false |
cifar10 |
cifar10 |
99.4 |
false |
cifar100 |
cifar100 |
94.1 |
false |
food101 |
food101 |
97.2 |
false |
dtd |
dtd |
88.9 |
false |
oxford - pets |
oxford - pets |
97.1 |
false |
stanford - cars |
stanford - cars |
96.6 |
false |
camelyon17 |
camelyon17 |
93.5 |
false |
patch - camelyon |
patch - camelyon |
89.9 |
false |
rxrx1 |
rxrx1 |
9.2 |
false |
eurosat |
eurosat |
99.1 |
false |
fmow |
fmow |
65.9 |
false |
domainnet - infographic |
domainnet - infographic |
74.4 |
false |
引用信息
如果您覺得我們的工作有用,請考慮按以下方式引用:
@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},
}
參考鏈接
[AIMv2 Paper
] [BibTeX
]
模型概述圖

📄 許可證
本項目使用的許可證為apple-amlr
。