Skip to content

Enums

Enumeration types for MGT-python parameter validation.

Using StrEnum so that enum members compare equal to their string values, maintaining full backward compatibility with code that passes plain strings. All enumerations support case-insensitive construction:

>>> BlurType("average") == BlurType.AVERAGE
True
>>> BlurType("AVERAGE") == BlurType.AVERAGE
True

FilterType

Bases: _MgEnum

Pixel-value filter applied to the frame-difference stream.

Attributes:

Name Type Description
REGULAR

Values below threshold are set to 0; values above are kept as-is.

BINARY

Values below threshold → 0; values above threshold → 255.

BLOB

Individual pixels are removed with an erosion filter.

BlurType

Bases: _MgEnum

Spatial blur applied before the frame-difference computation.

Attributes:

Name Type Description
NONE

No blurring is applied.

AVERAGE

A 10 × 10 pixel box-blur is applied.

CropMode

Bases: _MgEnum

Video cropping strategy.

Attributes:

Name Type Description
NONE

No cropping.

MANUAL

Opens an interactive window; the user draws a rectangle.

AUTO

Automatically detects the area of significant motion.

PoseModel

Bases: _MgEnum

Pose estimation skeleton model.

Attributes:

Name Type Description
BODY_25

OpenPose BODY_25 dataset (25 keypoints).

COCO

COCO dataset (18 keypoints).

MPI

MPII dataset (15 keypoints).

MEDIAPIPE

Google MediaPipe Pose (33 landmarks).

PoseDevice

Bases: _MgEnum

Compute backend for pose estimation inference.

Attributes:

Name Type Description
CPU

Run on CPU.

GPU

Run on GPU (CUDA / OpenCL).

DataFormat

Bases: _MgEnum

Output data file format.

Attributes:

Name Type Description
CSV

Comma-separated values.

TSV

Tab-separated values.

TXT

Plain text (space-separated).

Note

JSON and HDF5 are reserved for future use and are not yet implemented by any processing function. Passing them will silently fall back to CSV. Use 'csv', 'tsv', or 'txt'.