Glossary

The following are built-in data types recognized by PeekingDuck nodes. Users can define custom data types when working with custom nodes.

(input) all (Any)

This data type contains all the outputs from preceding nodes, granting a large degree of flexibility to nodes that receive it. Examples of such nodes include draw.legend, dabble.statistics, and output.csv_writer.

bboxes (numpy.ndarray)

A NumPy array of shape \((N, 4)\) containing normalized bounding box coordinates of \(N\) detected objects. Each bounding box is represented as \((x_1, y_1, x_2, y_2)\) where \((x_1, y_1)\) is the top-left corner and \((x_2, y_2)\) is the bottom-right corner. The order corresponds to bbox_labels and bbox_scores.

bbox_labels (numpy.ndarray)

A NumPy array of shape \((N)\) containing strings representing the labels of detected objects. The order corresponds to bboxes and bbox_scores.

bbox_scores (numpy.ndarray)

A NumPy array of shape \((N)\) containing confidence scores \([0, 1]\) of detected objects. The order corresponds to bboxes and bbox_labels.

btm_midpoint (List[Tuple[int, int]])

A list of tuples each representing the \((x, y)\) coordinates of the bottom middle of a bounding box for use in zone analytics. The order corresponds to bboxes.

count (int)

An integer representing the number of counted objects.

cum_avg (float)

Cumulative average of an attribute over time.

cum_max (float | int)

Cumulative maximum of an attribute over time.

cum_min (float | int)

Cumulative minimum of an attribute over time.

density_map (numpy.ndarray)

A NumPy array of shape \((H, W)\) representing the number of persons per pixel. \(H\) and \(W\) are the height and width of the input image, respectively. The sum of the array is the estimated total number of people.

filename (str)

The filename of video/image being read.

fps (float)

A float representing the Frames Per Second (FPS) when processing a live video stream or a recorded video.

img (numpy.ndarray)

A NumPy array of shape \((height, width, channels)\) containing the image data in BGR format.

keypoints (numpy.ndarray)

A NumPy array of shape \((N, K, 2)\) containing the \((x, y)\) coordinates of detected poses where \(N\) is the number of detected poses, and \(K\) is the number of individual keypoints. Keypoints with low confidence scores (below threshold) will be replaced by -1.

keypoint_conns (numpy.ndarray)

A NumPy array of shape \((N, D_n', 2, 2)\) containing the \((x, y)\) coordinates of adjacent keypoint pairs where \(N\) is the number of detected poses, and \(D_n'\) is the number of valid keypoint pairs for the the \(n\)-th pose where both keypoints are detected.

keypoint_scores (numpy.ndarray)

A NumPy array of shape \((N, K)\) containing the confidence scores of detected poses where \(N\) is the number of detected poses and \(K\) is the number of individual keypoints. The confidence score has a range of \([0, 1]\).

large_groups (List[int])

A list of integers representing the group IDs of groups that have exceeded the size threshold.

masks (numpy.ndarray)

A NumPy array of shape \((N, H, W)\) containing \(N\) detected binarized masks where \(H\) and \(W\) are the height and width of the masks. The order corresponds to bbox_labels.

(input) none

No inputs required.

(output) none

No outputs produced.

obj_3D_locs (List[numpy.ndarray])

A list of \(N\) NumPy arrays representing the 3D coordinates \((x, y, z)\) of an object associated with a detected bounding box.

obj_attrs (Dict[str, Any])

A dictionary of attributes associated with each bounding box, in the same order as bboxes. Different nodes that produce this obj_attrs output type may contribute different attributes.

pipeline_end (bool)

A boolean that evaluates to True when the pipeline is completed. Suitable for operations that require the entire inference pipeline to be completed before running.

saved_video_fps (float)

FPS of the recorded video, upon filming.

zones (List[List[Tuple[float, ...]]])

A nested list of \(Z\) zones. Each zone is described by \(3\) or more points which contains the \((x, y)\) coordinates forming the boundary of a zone. The order corresponds to zone_count.

zone_count (List[int])

A list of integers representing the count of a pre-selected object class (for example, “person”) detected in each specified zone. The order corresponds to zones.

Deprecated since version 1.2.0: obj_tags (List[str]) is deprecated and now subsumed under obj_attrs. dabble.check_nearby_objs now accesses this attribute by using the flags key of obj_attrs. draw.tag has been refactored for more drawing flexibility by accepting obj_attrs as input.

Deprecated since version 1.2.0: obj_groups (List[int]) is deprecated and now subsumed under obj_attrs. Affected nodes (dabble.group_nearby_objs, dabble.check_large_groups, and draw.group_bbox_and_tag) now access this attribute by using the groups key of obj_attrs.