🚀 Recap-CLIP-ViT-L-16-Txt-Huge-2.56B模型卡片
Recap-CLIP-ViT-L-16-Txt-Huge-2.56B是一個基於CLIPA架構的模型,在Recap-DataComp-1B數據集上進行訓練,可用於零樣本圖像分類等任務。
🚀 快速開始
本模型可用於零樣本圖像分類任務,以下是使用OpenCLIP庫調用模型的示例代碼。
✨ 主要特性
- 模型類型:對比式圖像 - 文本模型,可用於零樣本圖像分類。
- 原始項目: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
📦 安裝指南
暫未提供相關安裝步驟,可參考OpenCLIP庫的官方文檔進行安裝。
💻 使用示例
基礎用法
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)
🔧 技術細節
本模型是一個對比式圖像 - 文本模型,用於零樣本圖像分類。它在Recap-DataComp-1B數據集上進行訓練,該數據集包含大量的圖像 - 文本對。模型通過對比圖像和文本的特徵,實現對圖像的分類。
📄 許可證
本模型遵循CC BY 4.0許可證。
⚠️ 重要提示
本模型在使用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
📊 模型信息表格
屬性 |
詳情 |
模型類型 |
對比式圖像 - 文本,零樣本圖像分類 |
原始項目 |
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 |