🚀 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团队编写。
✨ 主要特性
🚀 快速开始
模型用途
你可以使用该原始模型将视频分类到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-small-finetuned-kinetics")
model = VideoMAEForVideoClassification.from_pretrained("MCG-NJU/videomae-small-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])
更多代码示例,请参考文档。
📚 详细文档
模型描述
VideoMAE将视频以固定大小块(分辨率16x16)的序列形式呈现给模型,这些块进行线性嵌入。同时,在序列开头添加一个[CLS]标记用于分类任务。在将序列输入到Transformer编码器层之前,还会添加固定的正弦/余弦位置嵌入。
通过预训练,模型学习到视频的内部表示,可用于提取对下游任务有用的特征。例如,如果你有一个带标签的视频数据集,可以在预训练编码器顶部放置一个线性层来训练一个标准分类器。通常会在[CLS]标记顶部放置一个线性层,因为该标记的最后隐藏状态可视为整个视频的表示。
预期用途和局限性
你可以使用该原始模型将视频分类到400种可能的Kinetics - 400标签中的某一类。
评估结果
该模型在Kinetics - 400测试集上的top - 1准确率为79.0,top - 5准确率为93.8。
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许可证。