nemo_curator.stages.video.filtering.motion_vector_backend
nemo_curator.stages.video.filtering.motion_vector_backend
Module Contents
Classes
Functions
Data
API
Container for decoded video frames containing motion vector data.
This class stores a list of decoded frames, each containing motion vector data, and the dimensions of the RGB decoded frame used to construct the flow vector.
Calculate total size in bytes of all frames in the decoded data.
Returns: int
Total size in bytes.
Container for motion detection results.
This class stores the results of motion detection analysis, including:
- Whether the video has small motion
- The minimum motion value in a 256x256 patch
- The global average motion value across the entire videoq
Bases: Exception
Exception raised when video resolution is below the minimum required size.
This error occurs when either the width or height of the video is less than the minimum resolution threshold required for motion detection.
Check if a video has small motion.
This function checks if a video has small motion by calculating the global mean and per-pixel average motion values.
Parameters:
List of motion vectors.
Shape of the frame.
Threshold for global mean motion.
Threshold for per-patch minimum motion.
Whether to use GPU for computation.
Size of the batch for processing.
Returns: MotionInfo
MotionInfo object containing the results of the motion detection.
Decode video for motion detection.
This function decodes a video stream to extract motion vectors.
Parameters:
Input video stream as a bytes object.
Number of threads to use for decoding.
Target frames per second for motion detection.
Ratio of target duration to source duration.
Returns: DecodedData
DecodedData object containing motion vectors and frame dimensions.
Compute a canonical flow from motion vectors.