🚀 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 |