许可证: apache-2.0
数据集:
- coco
- conceptual-caption
- sbu
- flickr30k
- vqa
- gqa
- vg-qa
- open-images
库名称: pytorch
标签:
模型卡片: VinVL图像描述生成模型 🖼️
微软VinVL基础预训练模型,专为图像描述生成下游任务设计。
COCO测试集指标 📈
作者提供的数据表(表7,交叉熵优化)
Bleu-4 |
METEOR |
CIDEr |
SPICE |
0.38 |
0.30 |
1.29 |
0.23 |
安装与使用指南
更多关于安装和使用该模型的信息,请访问: michelecafagna26/VinVL
特征提取 ⛏️
该模型配备独立的视觉骨干网络用于特征提取。
了解更多:
快速开始 🚀
from transformers.pytorch_transformers import BertConfig, BertTokenizer
from oscar.modeling.modeling_bert import BertForImageCaptioning
from oscar.wrappers import OscarTensorizer
ckpt = "检查点路径"
device = "cuda" if torch.cuda.is_available() else "cpu"
config = BertConfig.from_pretrained(ckpt)
tokenizer = BertTokenizer.from_pretrained(ckpt)
model = BertForImageCaptioning.from_pretrained(ckpt, config=config).to(device)
tensorizer = OscarTensorizer(tokenizer=tokenizer, device=device)
visual_features = torch.from_numpy(feat_obj).to(device).unsqueeze(0)
labels = [['boat', 'boat', 'boat', 'bottom', 'bush', 'coat', 'deck', 'deck', 'deck', 'dock', 'hair', 'jacket']]
inputs = tensorizer.encode(visual_features, labels=labels)
outputs = model(**inputs)
pred = tensorizer.decode(outputs)
引用文献 🧾
请引用原始项目和VinVL论文
@misc{han2021image,
title={图像场景图生成(SGG)基准测试},
author={韩晓天 and 杨建伟 and 胡厚东 and 张磊 and 高剑峰 and 张鹏川},
year={2021},
eprint={2107.12604},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
@inproceedings{zhang2021vinvl,
title={Vinvl: 视觉语言模型中的视觉表征再探索},
author={张鹏川 and 李修君 and 胡晓伟 and 杨建伟 and 张磊 and 王丽娟 and 崔艺珍 and 高剑峰},
booktitle={IEEE/CVF计算机视觉与模式识别会议论文集},
pages={5579--5588},
year={2021}
}