🚀 圖像特徵提取庫transformers
transformers是一個用於圖像特徵提取的庫,它引入了基於多模態自迴歸目標預訓練的AIMv2系列視覺模型。該模型預訓練簡單直接,能有效進行訓練和擴展,在多個多模態理解基準測試中表現出色。
🚀 快速開始
簡介
[AIMv2論文
] [BibTeX
]
我們引入了通過多模態自迴歸目標進行預訓練的AIMv2系列視覺模型。AIMv2的預訓練過程簡單直接,並且能夠有效地進行訓練和擴展。AIMv2的一些亮點包括:
- 在大多數多模態理解基準測試中優於OAI CLIP和SigLIP。
- 在開放詞彙對象檢測和指代表達理解方面優於DINOv2。
- 展現出強大的識別性能,AIMv2 - 3B在使用凍結主幹的情況下在ImageNet上達到了*89.5%的準確率。

📦 安裝指南
文檔未提供安裝步驟,跳過此章節。
💻 使用示例
基礎用法
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-336",
)
model = AutoModel.from_pretrained(
"apple/aimv2-huge-patch14-336",
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-336",
)
model = FlaxAutoModel.from_pretrained(
"apple/aimv2-huge-patch14-336",
trust_remote_code=True,
)
inputs = processor(images=image, return_tensors="jax")
outputs = model(**inputs)
📚 詳細文檔
模型指標
屬性 |
詳情 |
庫名稱 |
transformers |
許可證 |
apple - amlr |
評估指標 |
準確率 |
任務類型 |
圖像特徵提取 |
標籤 |
視覺、圖像特徵提取、mlx、pytorch |
模型結果
模型名稱 |
任務類型 |
數據集 |
準確率 |
驗證狀態 |
aimv2 - huge - patch14 - 336 |
分類 |
imagenet - 1k |
88.2 |
未驗證 |
aimv2 - huge - patch14 - 336 |
分類 |
inaturalist - 18 |
81.0 |
未驗證 |
aimv2 - huge - patch14 - 336 |
分類 |
cifar10 |
99.3 |
未驗證 |
aimv2 - huge - patch14 - 336 |
分類 |
cifar100 |
93.6 |
未驗證 |
aimv2 - huge - patch14 - 336 |
分類 |
food101 |
96.6 |
未驗證 |
aimv2 - huge - patch14 - 336 |
分類 |
dtd |
88.8 |
未驗證 |
aimv2 - huge - patch14 - 336 |
分類 |
oxford - pets |
96.8 |
未驗證 |
aimv2 - huge - patch14 - 336 |
分類 |
stanford - cars |
96.4 |
未驗證 |
aimv2 - huge - patch14 - 336 |
分類 |
camelyon17 |
93.3 |
未驗證 |
aimv2 - huge - patch14 - 336 |
分類 |
patch - camelyon |
89.4 |
未驗證 |
aimv2 - huge - patch14 - 336 |
分類 |
rxrx1 |
7.2 |
未驗證 |
aimv2 - huge - patch14 - 336 |
分類 |
eurosat |
98.7 |
未驗證 |
aimv2 - huge - patch14 - 336 |
分類 |
fmow |
63.9 |
未驗證 |
aimv2 - huge - patch14 - 336 |
分類 |
domainnet - infographic |
73.4 |
未驗證 |
📄 許可證
本項目使用apple - amlr許可證。
📖 引用
如果您覺得我們的工作有用,請考慮按以下方式引用:
@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},
}