«
class documentation

A list of object detections in an image.

Parameters
detectionsa list of Detection instances
Method to_polylines Returns a Polylines representation of this instance.
Method to_segmentation Returns a Segmentation representation of this instance.
Class Variable detections Undocumented
Constant _LABEL_LIST_FIELD Undocumented

Inherited from Label (via _HasLabelList):

Method delete_attribute Deletes the attribute with the given name.
Method get_attribute_value Gets the value of the attribute with the given name.
Method has_attribute Determines whether the label has an attribute with the given name.
Method iter_attributes Returns an iterator over the custom attributes of the label.
Method set_attribute_value Sets the value of the attribute with the given name.
def to_polylines(self, tolerance=2, filled=True): (source)

Returns a Polylines representation of this instance.

For detections with masks, the returned polylines will trace the boundaries of the masks; otherwise, the polylines will trace the bounding boxes themselves.

Parameters
tolerance:2a tolerance, in pixels, when generating approximate polylines for the instance masks
filled:Truewhether the polylines should be filled
Returns
a Polylines
def to_segmentation(self, mask=None, frame_size=None, mask_targets=None): (source)

Returns a Segmentation representation of this instance.

Only detections with instance masks (i.e., their mask attributes populated) will be rendered.

You must provide either mask or frame_size to use this method.

Parameters
mask:Nonean optional array to use as an initial mask to which to add objects
frame_size:Nonethe (width, height) of the segmentation mask to render. This parameter has no effect if a mask is provided
mask_targets:Nonea dict mapping integer pixel values (2D masks) or RGB hex strings (3D masks) to label strings defining which object classes to render and which pixel values to use for each class. If omitted, all objects are rendered with pixel value 255
Returns
a Segmentation
detections: None = (source)

Undocumented

_LABEL_LIST_FIELD: str = (source)

Undocumented

Value
'detections'