Box
Box #
Bases: BaseModel
Used in the Locate and Draw Validation sets. All coordinates are in ratio of the image size (0.0 to 1.0).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x_min
|
float
|
The minimum x value of the box in ratio of the image size. |
required |
y_min
|
float
|
The minimum y value of the box in ratio of the image size. |
required |
x_max
|
float
|
The maximum x value of the box in ratio of the image size. |
required |
y_max
|
float
|
The maximum y value of the box in ratio of the image size. |
required |
calculate_boxes_coverage #
calculate_boxes_coverage(boxes: list[Box]) -> float
Calculate the ratio of image area covered by a list of boxes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
boxes
|
list[Box]
|
List of Box objects with coordinates in range [0, 1]. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Coverage ratio between 0.0 and 1.0. |