template<bool UseCoordinates = false>
class mlpack::metric::IoU< UseCoordinates >
Definition of Intersection over Union metric.
For bounding box representation there are two common representation either as coordinates i.e. each value in vector represents a coordinate in the format x0, y0, x1, y1 where x0, y0 represent the lower left coordinate and x1, y1, represent upper right coordinate.
Second representation follows the following representation : x0, y0, h, w. Where x0 and y0 are bottom left bounding box coordinates and h, w are height and width of the bounding box.
- Template Parameters
-
useCoordinates | Toggles between the two representation of bounding box. If true, each value in vector represents a coordinate in the formate x0, y0, x1, y1. Else the bounding box is represented as x0, y0, h, w. |
template<bool UseCoordinates>
template<typename VecTypeA , typename VecTypeB >
VecTypeA::elem_type mlpack::metric::IoU< UseCoordinates >::Evaluate |
( |
const VecTypeA & |
a, |
|
|
const VecTypeB & |
b |
|
) |
| |
|
static |
Computes the Intersection over Union metric between of two bounding boxes having pattern bx, by, h, w.
- Template Parameters
-
VecTypeA | Type of first vector. |
VecTypeB | Type of second vector. |
- Parameters
-
a | First vector. |
b | Second vector. |
- Returns
- IoU of vectors a and b.