Skip to content

Video understanding, tracking, generation, and world models · Temporal localization · VID017 · Architecture

ActionFormer

Finds action intervals in untrimmed video using a transformer-based temporal feature pyramid and per-location predictions.

Runs as a notebook Complete calculation CodeSplash's run and the reference's record

In CodeSplash

No method yet, but the reference's example runs here as a notebook.

Do it in CodeSplash Open the reference's example as a Python or R notebook.

Availability
Runs as a notebook
Code example
Complete calculation
Who ran it
CodeSplash's run and the reference's record
CodeSplash's run
The reference's example ran in Python and R here, and they agree.
The reference's record
Python: Ran in the reference's review. The report doesn't record which version of the code ran. R: Reviewed but not run: R wasn't available to the reference's authors.

Purpose

Finds action intervals in untrimmed video using a transformer-based temporal feature pyramid and per-location predictions. Unlike clip classification, it predicts both the action category and when an instance begins and ends.

Question / objective

Estimate the class, beginning and end of action instances in untrimmed video. This is a learning or inference objective, not a test of a statistical null hypothesis.

Method type and supervision

architecture · Temporal localization. Supervised action-instance classes and temporal boundaries.

Architecture / computational structure

Temporal transformer feature pyramid with pointwise classification and boundary-regression heads.

Assumptions

Inputs must satisfy the temporal, modality and annotation protocol described below. Feature stride sets a localization-resolution limit. Duration distributions, overlapping activities and annotation conventions can dominate generalization.

Formula / computational definition

At time tt, predict class scores ptp_t and nonnegative distances (dtL,dtR)(d_t^L,d_t^R), giving interval [t−dtL,t+dtR][t-d_t^L,t+d_t^R]. Training combines classification and interval-regression losses; exact weighting follows the selected implementation.

Parameters and notation

Learned/estimated quantities: Feature, classification and interval-regression weights are learned; proposal filters and evaluation IoUs are user choices. Symbols specific to the objective are defined with the equation. Hyperparameters and design choices: Feature sampling rate, pyramid scales, local-attention window, regression ranges, score thresholds and suppression policy matter.

Fitting, fine-tuning, and adaptation

Fit detection heads on frozen features first; adapt the temporal backbone next. Recalibrate duration ranges and proposal thresholds on validation videos. Use a separate adaptation validation split, monitor the target metric and retention of previously useful behavior, and save the exact preprocessing and training configuration.

How to use and calibrate

Fix the input protocol and target before fitting; choose design settings on held-out source videos, then freeze the evaluation procedure. Report mean average precision at specified temporal IoUs, by duration and class; keep all proposals from one source video in one split.

Example application

Locate every occurrence of a sport action in an untrimmed match.

Interpretation / pitfalls

Watch out

An optimized training objective or a favorable example does not establish generalization. Report mean average precision at specified temporal IoUs, by duration and class; keep all proposals from one source video in one split. The example below isolates one mechanism and cannot substantiate a full-model benchmark claim.

Python and R code examples

Component: Decode temporal boundary distances and calculate interval IoU. Dependencies: NumPy in Python; base R in R; run the shared setup above. Python component: executed successfully. R component: unexecuted. No complete model training or pretrained inference was executed.

Full implementation route — Python: Reproduce the paper-linked pipeline with fixed feature extractor and temporal units; convert frames to seconds consistently. R: Analyze intervals and temporal-IoU matching in R; invoke the Python proposal model through reticulate or files.

Python and R

The reference's own programs, shown as written. A component demo shows one central piece of the method; it doesn't train a full model.

Python

Complete calculation — Decode temporal boundary distances and calculate interval IoU.

Shared setup for this chapter
import numpy as np

def softmax(x):
    z = np.asarray(x, dtype=float)
    e = np.exp(z - z.max())
    return e / e.sum()
center, left, right = 5.,2.,3.
pred = np.array([center-left,center+right]); truth = np.array([4.,9.])
intersection = max(0.,min(pred[1],truth[1])-max(pred[0],truth[0]))
union = (pred[1]-pred[0])+(truth[1]-truth[0])-intersection
print(pred,"tIoU",intersection/union)
R

Complete calculation — Decode temporal boundary distances and calculate interval IoU.

Shared setup for this chapter
softmax <- function(x) {
  e <- exp(x - max(x))
  e / sum(e)
}
center <- 5; left <- 2; right <- 3
pred <- c(center-left,center+right); truth <- c(4,9)
inter <- max(0,min(pred[2],truth[2])-max(pred[1],truth[1]))
union <- diff(pred)+diff(truth)-inter
print(pred); print(inter/union)

Sources

From the CodeSplash reference, entry VID017.