CaptionFormer: Unified Segmentation, Tracking, and Captioning for Spatio-Temporal Objects

Gabriel Fiastre, Antoine Yang, Cordelia Schmid

TL;DR

CaptionFormer is the first end-to-end model capable of simultaneously detecting, segmenting, tracking, and captioning object trajectories in videos. To overcome the severe scarcity of manual object-level video descriptions, the authors introduced a visual-textual prompting strategy to automatically generate large-scale synthetic datasets (LVISCap and LV-VISCap), powering CaptionFormer to achieve state-of-the-art results across multiple dense video captioning benchmarks.

What Problem Does This Paper Address?

While modern Vision-Language Models (VLMs) excel at describing entire video scenes, Dense Video Object Captioning (DVOC) requires a much finer grain of understanding: a model must track every individual object trajectory and describe its specific actions over time.

The primary bottleneck for DVOC is data. Manually annotating pixel-precise masks, tracking IDs, and natural language descriptions for every object in a video is prohibitively expensive. Consequently, prior methods have relied on disjointed training strategies—separating object detection, tracking, and cropping into isolated steps before feeding static crops to a text decoder. This lack of end-to-end training leads to suboptimal performance and fails to capture the rich temporal dynamics of moving objects.

Methods

The authors tackle the DVOC problem with a two-pronged approach: automated data generation and a unified model architecture.

1. Synthetic Data Generation Pipeline

To bypass costly manual annotation, the authors developed a multi-modal prompting pipeline leveraging a state-of-the-art VLM (Gemini 2.0 Flash). For a given object trajectory, they overlay its bounding boxes directly onto the video frames (the visual prompt) and supply a text prompt containing metadata like box coordinates, area, and category labels. This dual-channel prompting forces the VLM to focus specifically on the targeted entity and generate highly accurate, localized captions.

Figure 2. Our CaptionFormer data annotation pipeline: For each object, we extract its bounding boxes Bj from its annotated masks Mj, and draw them in the video. The video with drawn bounding boxes ˆxj, along with a prompt (ps, pu(j)) including additional information such as the label of the object to caption Cj, the labels and bounding boxes of other objects in the image, is fed to a state-of-the-art VLM (Gemini 2.0 Flash [59]) to generate the object-level caption. ps denotes the static prompt with general instructions and pu(j) the dynamic prompt with annotation information. We use this pipeline to generate the LVISCap and LV-VISCap datasets, used to train CaptionFormer.

2. CaptionFormer Architecture

CaptionFormer is designed as a unified, end-to-end network that processes videos clip-by-clip:

  • Clip-level Processing: It utilizes an open-vocabulary video instance segmentation model (OVFormer, built on Mask2Former) to generate clip-level object queries, bounding boxes, and segmentation masks.
  • Video-level Tracking: A semi-online tracking module associates these queries across clips using a Hungarian bipartite matching algorithm to form complete object trajectories.
  • Temporal Aggregation & Captioning: Unlike previous architectures that caption frame-by-crop, CaptionFormer introduces a temporal aggregation module. It samples object queries across the entire trajectory, weights them by their class-agnostic detection confidence scores, and merges them into a single video-level query. This aggregated query is then decoded by a frozen LLM (OPT-2.7B via a BLIP-2 interface) to produce the final trajectory caption.
Figure 3. Our CaptionFormer architecture jointly segments and captions objects in videos. For each clip of T frames, we obtain Nobj clip-level object queries through Mask2Former [15], and yield associated score, mask and box predictions. At a video-level, we match the predicted object queries with the previously processed clips with the Hungarian bipartite matching algorithm, and perform instance tracking [82]. For each track, we sample Tagg clips uniformly across the video, and aggregate the tracked queries to obtain a single video query per object, which we can feed to the LLM captioning head [39], producing a single caption per trajectory.

Datasets

The paper introduces two new synthetically enhanced datasets for pretraining:

  • LVISCap: Extends the LVIS image dataset with 1.2 million object-level captions.
  • LV-VISCap: Extends the LV-VIS video dataset, contributing 16,000 object trajectory captions.

For evaluation, the model was tested on three established benchmarks:

  • VidSTG: A spatio-temporal video grounding dataset repurposed for DVOC.
  • Video Localized Narratives (VLN): Evaluates dense description capabilities.
  • BenSMOT: A benchmark tracking and captioning human trajectories.

Key Insights and Ideas

  • Multi-Modal Prompting Synergy: Simply showing a VLM a video mask isn't enough. Combining visual cues (drawing bounding boxes on frames) with explicit textual metadata (coordinates and category names) dramatically boosts the VLM's ability to generate accurate, object-centric descriptions.
  • Language as a Regularizer for Segmentation: Surprisingly, adding the captioning loss during training doesn't just help text generation—it significantly improves video instance segmentation performance (mAP). The language objective provides a rich training signal that refines the underlying object queries.
  • Log-Linear Data Scaling: The performance of the captioning head scales logarithmically with the amount of synthetic training data used, implying that further performance gains can be unlocked simply by scaling up the automated annotation pipeline.

Key Results

CaptionFormer achieved new state-of-the-art results across all evaluated benchmarks, measured primarily by the CHOTA metric (which geometrically binds detection, tracking association, and captioning accuracy):

  • VidSTG: Achieved a CHOTA score of 64.0, significantly outperforming the previous state-of-the-art DVOC-DS (56.9).
  • VLN: Reached a CHOTA score of 47.7 (up from 41.3).
  • BenSMOT: Improved the captioning quality metric (CIDEr) to 42.6, nearly doubling the previous best of 25.4.
  • Segmentation Boost: Enabling the captioning loss boosted the video instance segmentation mean Average Precision (mAP) on LV-VISCap from 31.7 to 34.2.

Limitations and Future Work

  • Temporal Window Constraints: Due to hardware memory limitations, the temporal aggregation module can currently sample a maximum of 32 clips per video, which may restrict its effectiveness on exceptionally long videos.
  • Tracking Error Propagation: Because the captioning head relies on aggregated queries from the tracking module, any upstream tracking failures (e.g., ID switches or missed detections) directly degrade the quality of the generated captions.
  • Synthetic Bias: While human evaluations confirmed that the synthetic captions are high quality, models trained purely on VLM-generated text inherit the stylistic biases and potential hallucinations of the teacher model.

Summary updated

BibTeX
@inproceedings{fiastre2026captionformer,
  author = {Gabriel Fiastre and Antoine Yang and Cordelia Schmid},
  title = {{CaptionFormer: Unified Segmentation, Tracking, and Captioning for Spatio-Temporal Objects}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2026},
  url = {https://openreview.net/forum?id=4xt72x45TO},
}
Figure