OpenViSTAI · Agents · Blockchain · Crypto
Menu
Image & Video AI

Timesformer Pytorch

Timesformer Pytorch is a Python library implementing the TimeSformer video-classification architecture in PyTorch, using divided space-time attention that applies temporal attention before spatial attention.

Independent OpenViST project profile, based on linked sources.

Timesformer Pytorch — OpenViST project profile in Image & Video AI.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use it when you need a PyTorch model implementation for classifying video frames and want the documented temporal-then-spatial attention variant.

Who it is for

  • Python developers adding video classification to an application
  • Practitioners prototyping video-understanding models with PyTorch

Documented uses

  • Classify batches of videos into configured classes.
  • Pass variable-length videos in one batch using a frame mask.
Before you choose

Requirements & limits

The repository is public and lists an MIT license. Its README documents installation with pip.

  • The implementation documents only the Divided Space-Time Attention variant.
  • The example expects video tensors arranged as batch × frames × channels × height × width.
  • The model configuration includes image size, patch size, frame count and number of output classes.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Set up the library and prepare a model call

Install the package and prepare the documented model, video batch and optional frame mask for a classification call.

Before you start

  • Python package installation with pip
  • PyTorch, imported as torch
  • Video data represented as batch × frames × channels × height × width

Steps

  1. Install the package with the command below.

    Documented command
    pip install timesformer-pytorch
  2. Import torch and TimeSformer from timesformer_pytorch.

  3. Configure TimeSformer with model settings such as image size, patch size, frame count and number of classes.

  4. Prepare a video tensor and, for variable-length videos batched together, a Boolean frame mask; the example passes both to the model.

Expected outcome

The documented call returns a prediction tensor with one row per video and one output per configured class.

Guide limitations

  • The README example uses randomly generated tensors rather than documenting video decoding or preprocessing.
  • The guide reflects documented setup and example usage, not an execution test.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
16 October 2026
Original website title
lucidrains/TimeSformer-pytorch · Official homepage title · retained in its source language