class documentation
class Detections(_HasLabelList, Label): (source)
A list of object detections in an image.
Parameters | |
detections | a list of Detection instances |
Method | to |
Returns a Polylines representation of this instance. |
Method | to |
Returns a Segmentation representation of this instance. |
Class Variable | detections |
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 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:2 | a tolerance, in pixels, when generating approximate polylines for the instance masks |
filled:True | whether the polylines should be filled |
Returns | |
a Polylines |
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:None | an optional 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 |
Returns | |
a Segmentation |