class documentation
class Polylines(_HasLabelList, Label): (source)
A list of polylines or polygons in an image.
Parameters | |
polylines | a list of Polyline instances |
Method | to |
Returns a Detections representation of this instance whose bounding boxes tightly enclose the polylines. |
Method | to |
Returns a Segmentation representation of this instance. |
Class Variable | polylines |
Undocumented |
Constant | _LABEL |
Undocumented |
Inherited from Label
(via _HasLabelList
):
Method | delete |
Deletes the attribute with the given name. |
Method | get |
Gets the value of the attribute with the given name. |
Method | has |
Determines whether the label has an attribute with the given name. |
Method | iter |
Returns an iterator over the custom attributes of the label. |
Method | set |
Sets the value of the attribute with the given name. |
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 | |
maskNone | an optional (width, height) at which to render instance masks for the polylines |
frameNone | used 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 |
Returns a Segmentation
representation of this instance.
You must provide either mask or frame_size to use this method.
Parameters | |
mask:None | an optional numpy array to use as an initial mask to which to add objects |
frameNone | the (width, height) of the segmentation mask to render. This parameter has no effect if a mask is provided |
maskNone | a 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:1 | the thickness, in pixels, at which to render (non-filled) polylines |
Returns | |
a Segmentation |