🚀 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 |