Skip to main content
Provides unified data structures for representing detection results from various computer vision frameworks, including bounding boxes, masks, keypoints, and tracking information. Designed for efficient processing and seamless integration across different ML frameworks and visualization tools.

Classes

  • KeyPoint - Represents a single keypoint with coordinate and visibility information for pose estimation.
  • Detection - Unified representation of a single object detection with comprehensive metadata and tracking.
  • Detections - Container for multiple Detection objects with comprehensive filtering and processing capabilities.

KeyPoint

Represents a single keypoint with coordinate and visibility information for pose estimation. Stores spatial coordinates and visibility state for structured keypoint data representation in pose estimation and object keypoint detection tasks. Provides a standardized format for keypoint data across different ML frameworks and coordinate systems.

Parameters

int
required
X coordinate in pixels from image left edge.
int
required
Y coordinate in pixels from image top edge.
str
required
Descriptive name or label for the keypoint (e.g., “nose”, “left_eye”).
bool
required
Whether the keypoint is visible and detectable in the image.

Example

Example

Detection

Unified representation of a single object detection with comprehensive metadata and tracking. Stores complete detection information including bounding boxes, segmentation masks, keypoints, classification data, tracking information, and spatial analytics. Provides a standardized interface for detection data across different ML frameworks with automatic validation and type conversion for consistent data handling.

Parameters

Optional[str]
Unique identifier for the inference session or batch.
Optional[List[float]]
Bounding box coordinates in XYXY format [x1, y1, x2, y2]. Automatically validated and normalized.
Optional[List[Any]]
Segmentation masks in various formats (binary arrays, polygons).
Optional[List[Any]]
Polygon segments for precise object boundaries.
Optional[List[KeyPoint]]
List of KeyPoint objects for pose/structure data.
Optional[Union[int, str]]
Numeric or string class identifier from model.
Optional[str]
Human-readable class name (e.g., “person”, “vehicle”).
Optional[List[str]]
Additional classification labels or attributes.
Optional[float]
Detection confidence score [0.0-1.0], automatically rounded to 4 decimal places for consistency.
Optional[int]
Unique tracking identifier for multi-frame object tracking.
Optional[Dict[str, Any]]
Additional custom metadata and framework-specific data.
Optional[List[str]]
List of zone identifiers the detection intersects. Defaults to empty list if None.
Optional[List[str]]
Human-readable names for intersected zones. Defaults to empty list if None.
Optional[List[Dict]]
Line crossing events for this detection. Defaults to empty list if None.
Optional[float]
Timestamp when detection first appeared (Unix time).
float
required
Total duration since first detection in seconds. Default is 0.0.

Example

Example

Detections

Container for multiple Detection objects with comprehensive filtering and processing capabilities. Provides a unified interface for managing collections of detections with support for iteration, indexing, filtering, zone management, serialization, and bulk operations. Implements standard Python container protocols and includes dynamically attached filter methods for zero-overhead detection processing and analysis workflows.

Example

Example