OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Models

Stam Pytorch

Stam Pytorch is a Python implementation of the Space Time Attention Model (STAM) for video classification. Built with PyTorch, it accepts batches of video frames and returns class scores.

Independent OpenViST project profile, based on linked sources.

Stam Pytorch — OpenViST project profile in AI Models.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use it when you already have video frames prepared as tensors and need a PyTorch STAM model to produce classification scores.

Who it is for

  • Developers building video-classification prototypes in Python and PyTorch.
  • Researchers or practitioners evaluating a space-time attention model on prepared video frames.

Documented uses

  • Configure a STAM model for a chosen frame size, clip length and number of output classes.
  • Pass batches of prepared video frames to the model and obtain class-score vectors.
Before you choose

Requirements & limits

The repository is public and specifies an MIT license. Its README gives `pip install stam-pytorch` as the installation command.

  • The example uses five frames per clip and 100 output classes, but exposes parameters for frame count, image size and class count.
  • The documented model input is a five-dimensional batch × frames × channels × height × width tensor.
  • The README does not provide a frame-extraction pipeline or dataset-loading workflow.

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

Install STAM-pytorch and classify a batch of frames

Install the package, create an STAM model, and pass it a batch of five-frame video samples to obtain class scores.

Before you start

  • Python environment with PyTorch available as torch.
  • Input frames shaped as batch × frames × channels × height × width; the example uses two batches of five 256×256 RGB frames.

Steps

  1. Install the package with the command below.

    Documented command
    pip install stam-pytorch
  2. Import torch and STAM from stam_pytorch, then create an STAM model; the example sets num_frames=5, image_size=256, and num_classes=100.

  3. Create a frame tensor, for example torch.randn(2, 5, 3, 256, 256), and pass it to the model with pred = model(frames).

  4. Use the returned scores, shaped (2, 100) in the example, as the model output for the two input samples.

Expected outcome

The model returns 100 class scores for each sample in the example batch.

Guide limitations

  • The example uses randomly generated frames; it does not document video decoding, frame sampling, labels, or evaluation.
  • The documented input configuration uses five frames at 256×256 resolution and returns scores for 100 classes; other configurations and performance are not demonstrated.
Evidence and transparency

Sources & review

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