🚀 トランスフォーマー
このライブラリは、画像特徴抽出に特化したビジョンモデルを提供します。マルチモーダル自己回帰目的で事前学習されたAIMv2ファミリーのモデルを利用し、多くのベンチマークで優れた性能を発揮します。
🚀 クイックスタート
このセクションでは、ライブラリの概要と使用方法を紹介します。
ライブラリ情報
属性 |
詳情 |
ライブラリ名 |
transformers |
ライセンス |
apple-amlr |
評価指標 |
accuracy |
パイプラインタグ |
image-feature-extraction |
タグ |
vision, image-feature-extraction, mlx, pytorch |
モデル情報
- モデル名: aimv2-large-patch14-448
モデルの性能
タスク |
データセット |
精度 |
分類 |
imagenet-1k |
87.9% |
分類 |
inaturalist-18 |
81.3% |
分類 |
cifar10 |
99.1% |
分類 |
cifar100 |
92.4% |
分類 |
food101 |
96.6% |
分類 |
dtd |
88.9% |
分類 |
oxford-pets |
96.5% |
分類 |
stanford-cars |
96.6% |
分類 |
camelyon17 |
94.1% |
分類 |
patch-camelyon |
89.6% |
分類 |
rxrx1 |
7.4% |
分類 |
eurosat |
98.6% |
分類 |
fmow |
62.8% |
分類 |
domainnet-infographic |
72.7% |
✨ 主な機能
- マルチモーダル理解ベンチマークの多くで、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-large-patch14-448",
)
model = AutoModel.from_pretrained(
"apple/aimv2-large-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-large-patch14-448",
)
model = FlaxAutoModel.from_pretrained(
"apple/aimv2-large-patch14-448",
trust_remote_code=True,
)
inputs = processor(images=image, return_tensors="jax")
outputs = model(**inputs)
📄 ライセンス
このライブラリは、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},
}
