Views
No views yet
1from transformers import VideoMAEImageProcessor, AutoModel, AutoConfig
2import numpy as np
3import torch
4
5
6config = AutoConfig.from_pretrained("OpenGVLab/VideoMAEv2-Large", trust_remote_code=True)
7processor = VideoMAEImageProcessor.from_pretrained("OpenGVLab/VideoMAEv2-Large")
8model = AutoModel.from_pretrained('OpenGVLab/VideoMAEv2-Large', config=config, trust_remote_code=True)
9
10
11video = list(np.random.rand(16, 3, 224, 224))
12
13
14
15
16# B, T, C, H, W -> B, C, T, H, W
17inputs = processor(video, return_tensors="pt")
18inputs['pixel_values'] = inputs['pixel_values'].permute(0, 2, 1, 3, 4)
19
20with torch.no_grad():
21 outputs = model(**inputs)1@InProceedings{wang2023videomaev2,
2 author = {Wang, Limin and Huang, Bingkun and Zhao, Zhiyu and Tong, Zhan and He, Yinan and Wang, Yi and Wang, Yali and Qiao, Yu},
3 title = {VideoMAE V2: Scaling Video Masked Autoencoders With Dual Masking},
4 booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
5 month = {June},
6 year = {2023},
7 pages = {14549-14560}
8}
9
10@misc{videomaev2,
11 title={VideoMAE V2: Scaling Video Masked Autoencoders with Dual Masking},
12 author={Limin Wang and Bingkun Huang and Zhiyu Zhao and Zhan Tong and Yinan He and Yi Wang and Yali Wang and Yu Qiao},
13 year={2023},
14 eprint={2303.16727},
15 archivePrefix={arXiv},
16 primaryClass={cs.CV}
17}