许可协议: "cc-by-nc-4.0"
标签:
VideoMAE (基础尺寸模型,基于Something-Something-v2微调)
VideoMAE模型采用自监督方式预训练2400轮次,并在Something-Something-v2数据集上进行监督式微调。该模型由Tong等人在论文VideoMAE: 掩码自编码器是数据高效的自监督视频预训练学习器中提出,并首发于此代码库。
免责声明:发布VideoMAE的团队未编写此模型卡片,本卡片由Hugging Face团队撰写。
模型描述
VideoMAE是掩码自编码器(MAE)在视频领域的扩展。模型架构与标准视觉Transformer(ViT)高度相似,顶部添加了用于预测掩码区块像素值的解码器。
视频以固定尺寸区块序列(16x16分辨率)的形式输入模型,经过线性嵌入处理。序列开头添加[CLS]标记用于分类任务,在输入Transformer编码器层前还会加入固定的正弦/余弦位置嵌入。
通过预训练,模型学习到视频的内部表征,可提取下游任务所需特征:例如在有标注视频数据集上,可在预训练编码器顶部添加线性层训练标准分类器。通常将线性层置于[CLS]标记之上,因该标记的最后隐藏状态可视为整个视频的表征。
预期用途与限制
您可使用该原始模型将视频分类为Kinetics-400数据集的400个可能类别之一。
使用方法
以下展示如何使用该模型进行视频分类:
from transformers import VideoMAEImageProcessor, VideoMAEForVideoClassification
import numpy as np
import torch
video = list(np.random.randn(16, 3, 224, 224))
processor = VideoMAEImageProcessor.from_pretrained("MCG-NJU/videomae-base-finetuned-ssv2")
model = VideoMAEForVideoClassification.from_pretrained("MCG-NJU/videomae-base-finetuned-ssv2")
inputs = processor(video, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
logits = outputs.logits
predicted_class_idx = logits.argmax(-1).item()
print("预测类别:", model.config.id2label[predicted_class_idx])
更多代码示例请参阅文档。
训练数据
(待补充,欢迎提交PR)
训练流程
预处理
(待补充,欢迎提交PR)
预训练
(待补充,欢迎提交PR)
评估结果
该模型在Something-Something-v2测试集上获得70.6的top-1准确率和92.6的top-5准确率。
BibTeX条目与引用信息
misc{https://doi.org/10.48550/arxiv.2203.12602,
doi = {10.48550/ARXIV.2203.12602},
url = {https://arxiv.org/abs/2203.12602},
author = {Tong, Zhan and Song, Yibing and Wang, Jue and Wang, Limin},
keywords = {Computer Vision and Pattern Recognition (cs.CV), FOS: Computer and information sciences, FOS: Computer and information sciences},
title = {VideoMAE: 掩码自编码器是数据高效的自监督视频预训练学习器},
publisher = {arXiv},
year = {2022},
copyright = {Creative Commons Attribution 4.0 International}
}