dsdl.geometry.box
BBox
Bases: BaseGeometry
Source code in /Users/bin/anaconda3/envs/dsdl/lib/python3.10/site-packages/dsdl/geometry/box.py
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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 |
|
area: _ELE_TYPE
property
Returns:
Type | Description |
---|---|
_ELE_TYPE
|
The bounding box's area. |
height: _ELE_TYPE
property
Returns:
Type | Description |
---|---|
_ELE_TYPE
|
The bounding box's height. |
openmmlabformat: List[_ELE_TYPE]
property
Returns:
Type | Description |
---|---|
List[_ELE_TYPE]
|
The bounding box's [xmin ymin xmax ymax] format, which is used in openmmlab project. |
width: _ELE_TYPE
property
Returns:
Type | Description |
---|---|
_ELE_TYPE
|
The bounding box's width. |
x: _ELE_TYPE
property
Returns:
Type | Description |
---|---|
_ELE_TYPE
|
The bounding box's top left point horizontal axis. |
xmax: _ELE_TYPE
property
Returns:
Type | Description |
---|---|
_ELE_TYPE
|
The bounding box's bottom right point horizontal axis. |
xmin: _ELE_TYPE
property
Returns:
Type | Description |
---|---|
_ELE_TYPE
|
The bounding box's top left point horizontal axis. |
xywh: List[_ELE_TYPE]
property
Returns:
Type | Description |
---|---|
List[_ELE_TYPE]
|
The bounding box's [x y w h] format. |
xyxy: List[_ELE_TYPE]
property
Returns:
Type | Description |
---|---|
List[_ELE_TYPE]
|
The bounding box's [xmin ymin xmax ymax] format. |
y: _ELE_TYPE
property
Returns:
Type | Description |
---|---|
_ELE_TYPE
|
The bounding box's top left point vertical axis. |
ymax: _ELE_TYPE
property
Returns:
Type | Description |
---|---|
_ELE_TYPE
|
The bounding box's bottom right point vertical axis. |
ymin: _ELE_TYPE
property
Returns:
Type | Description |
---|---|
_ELE_TYPE
|
The bounding box's top left point vertical axis. |
__init__(data, mode)
A Geometry class which abstracts a 2D bounding box object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
The bounding box's top left point horizontal axis. |
required | |
y |
The bounding box's top left point vertical axis. |
required | |
width |
The bounding box's width. |
required | |
height |
The bounding box's height. |
required |
Attributes:
Name | Type | Description |
---|---|---|
_data(list[float]) |
A list which contains the bounding box's top left point horizontal axis, top left point vertical axis, width and height. |
Source code in /Users/bin/anaconda3/envs/dsdl/lib/python3.10/site-packages/dsdl/geometry/box.py
to_float()
to_int()
visualize(image, palette, **kwargs)
Draw the current bounding box on an given image.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image |
The image where the bounding box to be drawn. |
required | |
palette |
The palette which stores the color of different category name. |
required | |
**kwargs |
Other annotations which may be used when drawing the current bounding box, such as |
{}
|
Returns:
Type | Description |
---|---|
The image where the current bounding box has been drawn on. |