pixano.utils.boxes
denormalize_coords(coord, height, width, rounded_int=True)
Denormalize coordinates
Parameters:
Name | Type | Description | Default |
---|---|---|---|
coord
|
list[float]
|
Normalized coordinates |
required |
height
|
int
|
Height |
required |
width
|
int
|
Width |
required |
rounded_int
|
bool
|
True to round denormalized float to nearest integer. Default to True |
True
|
Returns:
Type | Description |
---|---|
list[float]
|
Unnormalized coordinates, |
Source code in pixano/utils/boxes.py
mask_to_bbox(mask)
Return the smallest bounding box containing all the mask pixels
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mask
|
ndarray
|
Mask as NumPy Array |
required |
Returns:
Type | Description |
---|---|
list[float]
|
Normalized xywh bounding box |
Source code in pixano/utils/boxes.py
normalize_coords(coord, height, width)
Normalize coordinates
Parameters:
Name | Type | Description | Default |
---|---|---|---|
coord
|
list[float]
|
Unnormalized coordinates |
required |
height
|
int
|
Height |
required |
width
|
int
|
Width |
required |
Returns:
Type | Description |
---|---|
list[float]
|
Normalized coordinates |
Source code in pixano/utils/boxes.py
urle_to_bbox(urle)
xywh_to_xyxy(xywh)
Convert bounding box coordinates from xywh (using top left point as reference) to xyxy
Parameters:
Name | Type | Description | Default |
---|---|---|---|
xywh
|
list[float]
|
xywh coordinates |
required |
Returns:
Type | Description |
---|---|
list[float]
|
xyxy coordinates |
Source code in pixano/utils/boxes.py
xyxy_to_xywh(xyxy)
Convert bounding box coordinates from xyxy to xywh (using top left point as reference)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
xyxy
|
list[float]
|
xyxy coordinates |
required |
Returns:
Type | Description |
---|---|
list[float]
|
xywh coordinates |