Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Implementation:NVIDIA NeMo Curator TransNetV2ClipExtractionStage

From Leeroopedia
Knowledge Sources
Domains Data_Curation, Video_Processing, Computer_Vision
Last Updated 2026-02-14 17:00 GMT

Overview

Concrete tool for neural network-based scene detection and clip extraction using TransNetV2 provided by NeMo Curator.

Description

The TransNetV2ClipExtractionStage processes videos through the TransNetV2 shot boundary detection model to identify scene transitions, then segments the video into clips based on detected boundaries. It supports configurable duration bounds, boundary confidence thresholds, and multiple strategies for handling long scenes (truncate or stride).

Usage

Import this stage when you need content-aware video segmentation. Use FixedStrideExtractorStage for uniform-length clips instead.

Code Reference

Source Location

  • Repository: NeMo Curator
  • File: nemo_curator/stages/video/clipping/transnetv2_extraction.py
  • Lines: L71-324

Signature

@dataclass
class TransNetV2ClipExtractionStage(ProcessingStage[VideoTask, VideoTask]):
    model_dir: str = None
    threshold: float = 0.4
    min_length_s: float | None = 2.0
    max_length_s: float | None = 10.0
    max_length_mode: Literal["truncate", "stride"] = "stride"
    crop_s: float | None = 0.5
    entire_scene_as_clip: bool = True
    gpu_memory_gb: int = 10
    limit_clips: int = -1
    verbose: bool = False
    name: str = "transnetv2_clip_extraction"

Import

from nemo_curator.stages.video.clipping.transnetv2_extraction import TransNetV2ClipExtractionStage

I/O Contract

Inputs

Name Type Required Description
task VideoTask Yes Video with source_bytes and frame_array populated

Outputs

Name Type Description
task VideoTask Video with clips having detected scene spans

Usage Examples

from nemo_curator.stages.video.clipping.transnetv2_extraction import TransNetV2ClipExtractionStage

stage = TransNetV2ClipExtractionStage(
    model_dir="models/transnetv2",
    threshold=0.4,
    min_length_s=2.0,
    max_length_s=60.0,
    max_length_mode="stride",
)

Related Pages

Implements Principle

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment