Downloads · 30 days
11
2% of all-time downloads
fcakyon/timesformer-base-finetuned-ssv2
timesformer-base-finetuned-ssv2 is a video classification model from fcakyon. Use it for the video classification task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as cc-by-nc-4.0.
TimeSformer model pre-trained on Something Something v2. It was introduced in the paper TimeSformer: Is Space-Time Attention All You Need for Video Understanding? by Tong et al. and first released in this repository.
Downloads · 30 days
11
2% of all-time downloads
All-time downloads
512
Public
Repo size
971 MB
Likes
0
Public
Click a slice to open those files.
.bin486 MB · 100%
From the Hugging Face model README
TimeSformer model pre-trained on Something Something v2. It was introduced in the paper TimeSformer: Is Space-Time Attention All You Need for Video Understanding? by Tong et al. and first released in this repository.
Disclaimer: The team releasing TimeSformer did not write a model card for this model so this model card has been written by fcakyon.
You can use the raw model for video classification into one of the 174 possible Something Something v2 labels.
Here is how to use this model to classify a video:
from transformers import AutoImageProcessor, TimesformerForVideoClassification
import numpy as np
import torch
video = list(np.random.randn(8, 3, 224, 224))
processor = AutoImageProcessor.from_pretrained("fcakyon/timesformer-base-finetuned-ssv2")
model = TimesformerForVideoClassification.from_pretrained("fcakyon/timesformer-base-finetuned-ssv2")
inputs = processor(images=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])
For more code examples, we refer to the documentation.
@inproceedings{bertasius2021space,
title={Is Space-Time Attention All You Need for Video Understanding?},
author={Bertasius, Gedas and Wang, Heng and Torresani, Lorenzo},
booktitle={International Conference on Machine Learning},
pages={813--824},
year={2021},
organization={PMLR}
}