🚀 VideoMAE(基础大小模型,在Kinetics - 400上微调)
VideoMAE模型以自监督的方式预训练了1600个周期,并在Kinetics - 400上进行了有监督的微调。该模型由Tong等人在论文VideoMAE: Masked Autoencoders are Data - Efficient Learners for Self - Supervised Video Pre - Training中提出,并首次在[此仓库](https://github.com/MCG - NJU/VideoMAE)中发布。
免责声明:发布VideoMAE的团队并未为此模型编写模型卡片,此模型卡片由Hugging Face团队编写。
✨ 主要特性
VideoMAE是Masked Autoencoders (MAE)在视频领域的扩展。该模型的架构与标准的视觉Transformer (ViT)非常相似,顶部有一个解码器用于预测掩码块的像素值。
视频以固定大小的块序列(分辨率为16x16)的形式输入到模型中,并进行线性嵌入。同时,会在序列开头添加一个[CLS]标记,用于分类任务。在将序列输入到Transformer编码器层之前,还会添加固定的正弦/余弦位置嵌入。
通过对模型进行预训练,它可以学习到视频的内部表示,这些表示可用于提取对下游任务有用的特征。例如,如果您有一个带标签的视频数据集,可以在预训练的编码器顶部放置一个线性层来训练一个标准分类器。通常会在[CLS]标记的顶部放置一个线性层,因为该标记的最后隐藏状态可以看作是整个视频的表示。
🚀 快速开始
您可以使用原始模型将视频分类为400种可能的Kinetics - 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-kinetics")
model = VideoMAEForVideoClassification.from_pretrained("MCG-NJU/videomae-base-finetuned-kinetics")
inputs = processor(video, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
logits = outputs.logits
predicted_class_idx = logits.argmax(-1).item()
print("Predicted class:", model.config.id2label[predicted_class_idx])
更多代码示例,请参考文档。
📚 详细文档
评估结果
该模型在Kinetics - 400测试集上的top - 1准确率为80.9,top - 5准确率为94.7。
📄 许可证
本模型使用的许可证为"cc - by - nc - 4.0"。
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: Masked Autoencoders are Data-Efficient Learners for Self-Supervised Video Pre-Training},
publisher = {arXiv},
year = {2022},
copyright = {Creative Commons Attribution 4.0 International}
}
📦 信息表格
属性 |
详情 |
模型类型 |
VideoMAE(基础大小模型,在Kinetics - 400上微调) |
许可证 |
cc - by - nc - 4.0 |
标签 |
vision、video - classification |