🚀 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-large-finetuned-kinetics")
model = VideoMAEForVideoClassification.from_pretrained("MCG-NJU/videomae-large-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准确率为84.7,top - 5准确率为96.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: Masked Autoencoders are Data-Efficient Learners for Self-Supervised Video Pre-Training},
publisher = {arXiv},
year = {2022},
copyright = {Creative Commons Attribution 4.0 International}
}
📄 许可证
此模型遵循CC - BY - NC - 4.0许可证。
属性 |
详情 |
模型类型 |
VideoMAE(大型模型,在Kinetics - 400上微调) |
训练数据 |
暂未提供 |
训练过程 |
暂未提供 |