🚀 Recap-CLIP-ViT-L-16-Txt-Huge-2.56Bのモデルカード
Recap-DataComp-1Bで学習されたCLIPAモデルで、画像とテキストの関連性を捉え、ゼロショット画像分類を行うことができます。
🚀 クイックスタート
このモデルは、画像とテキストのゼロショット分類に使用できます。以下のセクションで、具体的な使い方を説明します。
✨ 主な機能
- コントラスト型の画像-テキストモデルで、ゼロショット画像分類が可能。
- Recap-DataComp-1Bデータセットで学習されている。
📦 インストール
このモデルを使用するには、open_clip
ライブラリが必要です。以下のコマンドでインストールできます。
pip install open_clip
💻 使用例
基本的な使用法
import torch
import torch.nn.functional as F
from urllib.request import urlopen
from PIL import Image
from open_clip import create_model_from_pretrained, get_tokenizer
model, preprocess = create_model_from_pretrained('hf-hub:UCSC-VLAA/ViT-L-16-HTxt-Recap-CLIP')
tokenizer = get_tokenizer('hf-hub:UCSC-VLAA/ViT-L-16-HTxt-Recap-CLIP')
image = Image.open(urlopen(
'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/beignets-task-guide.png'
))
image = preprocess(image).unsqueeze(0)
text = tokenizer(["a diagram", "a dog", "a cat", "a beignet"], context_length=model.context_length)
with torch.no_grad(), torch.cuda.amp.autocast():
image_features = model.encode_image(image)
text_features = model.encode_text(text)
image_features = F.normalize(image_features, dim=-1)
text_features = F.normalize(text_features, dim=-1)
text_probs = (100.0 * image_features @ text_features.T).softmax(dim=-1)
print("Label probs:", text_probs)
📚 ドキュメント
モデルの詳細
属性 |
详情 |
モデルタイプ |
コントラスト型画像-テキスト、ゼロショット画像分類 |
オリジナル |
https://github.com/UCSC-VLAA/Recap-DataComp-1B |
データセット |
https://huggingface.co/datasets/UCSC-VLAA/Recap-DataComp-1B |
論文 |
What If We Recaption Billions of Web Images with LLaMA-3?: https://arxiv.org/abs/2406.08478 |
バイアス、リスク、制限事項
このモデルは、LLaVA-1.5-LLaMA3-8Bで生成されたキャプションを持つ画像-テキストデータセットで学習されています。元のウェブクロールデータに内在するバイアスや不正確さが残っている可能性があります。ユーザーはこのモデルを使用する際に、バイアス、リスク、または制限事項に注意する必要があります。詳細については、データセットカードページを確認してください。
引用
@article{li2024recaption,
title={What If We Recaption Billions of Web Images with LLaMA-3?},
author={Xianhang Li and Haoqin Tu and Mude Hui and Zeyu Wang and Bingchen Zhao and Junfei Xiao and Sucheng Ren and Jieru Mei and Qing Liu and Huangjie Zheng and Yuyin Zhou and Cihang Xie},
journal={arXiv preprint arXiv:2406.08478},
year={2024}
}
モデルに関する問い合わせ
zwang615@ucsc.edu
📄 ライセンス
このモデルはCC-BY-4.0ライセンスの下で提供されています。