Views
No views yet
1git clone https://github.com/Go2Heart/StreamFormer.git
2cd StreamFormer
3conda create -n streamformer python=3.10
4conda activate streamformer
5conda install pytorch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 pytorch-cuda=12.4 -c pytorch -c nvidia
6pip install -r requirements.txt1from models import TimesformerMultiTaskingModelSigLIP
2import torch
3model = TimesformerMultiTaskingModelSigLIP.from_pretrained("StreamFormer/streamformer-timesformer").eval()
4with torch.no_grad():
5 fake_frames = torch.randn(1, 16, 3, 224, 224)
6 fake_frames = fake_frames.to(model.device)
7 output = model(fake_frames)
8 # global representation [B, D]
9 print(output.pooler_output[:,-1].shape, output.pooler_output[:,-1])
10
11 # temporal representation [B, T, D]
12 print(output.pooler_output.shape, output.pooler_output)
13
14 # spatial representation [B, T, HxW, D]
15 print(output.last_hidden_state.shape, output.last_hidden_state)1@misc{yan2025learning,
2 title={Learning Streaming Video Representation via Multitask Training},
3 author={Yibin Yan and Jilan Xu and Shangzhe Di and Yikun Liu and Yudi Shi and Qirui Chen and Zeqian Li and Yifei Huang and Weidi Xie},
4 year={2025},
5 eprint={2504.20041},
6 archivePrefix={arXiv},
7 primaryClass={cs.CV}
8}