Visualizers
MarkVisualizer
A class for visualizing different marks including bounding boxes, masks, polygons, and labels.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
line_thickness |
int
|
The thickness of the lines for boxes and polygons. |
2
|
mask_opacity |
float
|
The opacity level for masks. |
0.1
|
text_scale |
float
|
The scale of the text for labels. |
0.6
|
Source code in maestro/visualizers.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
|
visualize(image, marks, with_box=False, with_mask=False, with_polygon=True, with_label=True)
Visualizes annotations on an image.
This method takes an image and an instance of sv.Detections, and overlays the specified types of marks (boxes, masks, polygons, labels) on the image.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image |
ndarray
|
The image on which to overlay annotations. |
required |
marks |
Detections
|
The detection results containing the annotations. |
required |
with_box |
bool
|
Whether to draw bounding boxes. Defaults to False. |
False
|
with_mask |
bool
|
Whether to overlay masks. Defaults to False. |
False
|
with_polygon |
bool
|
Whether to draw polygons. Defaults to True. |
True
|
with_label |
bool
|
Whether to add labels. Defaults to True. |
True
|
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: The annotated image. |
Source code in maestro/visualizers.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
|