class documentation

A list of polylines or polygons in an image.

Parameters
polylinesa list of Polyline instances
Method to_detections Returns a Detections representation of this instance whose bounding boxes tightly enclose the polylines.
Method to_segmentation Returns a Segmentation representation of this instance.
Class Variable polylines 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_detections(self, mask_size=None, frame_size=None): (source)

Returns a Detections representation of this instance whose bounding boxes tightly enclose the polylines.

If a mask_size is provided, instance masks of the specified size encoding the polyline's shape are included in each Detection.

Alternatively, if a frame_size is provided, the required mask size is then computed based off of the polyline points and frame_size.

Parameters
mask_size:Nonean optional (width, height) at which to render instance masks for the polylines
frame_size:Noneused when no mask_size is provided. an optional (width, height) of the frame containing these polylines that is used to compute the required mask_size
Returns
a Detections
def to_segmentation(self, mask=None, frame_size=None, mask_targets=None, thickness=1): (source)

Returns a Segmentation representation of this instance.

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

Parameters
mask:Nonean optional numpy 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
thickness:1the thickness, in pixels, at which to render (non-filled) polylines
Returns
a Segmentation
polylines: None = (source)

Undocumented

_LABEL_LIST_FIELD: str = (source)

Undocumented

Value
'polylines'