mlpack
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
mlpack::metric::IoU< UseCoordinates > Class Template Reference

Definition of Intersection over Union metric. More...

#include <iou_metric.hpp>

Public Member Functions

 IoU ()
 Default constructor required to satisfy the Metric policy.
 
template<typename Archive >
void serialize (Archive &ar, const uint32_t)
 Serialize the metric.
 

Static Public Member Functions

template<typename VecTypeA , typename VecTypeB >
static VecTypeA::elem_type Evaluate (const VecTypeA &a, const VecTypeB &b)
 Computes the Intersection over Union metric between of two bounding boxes having pattern bx, by, h, w. More...
 

Static Public Attributes

static const bool useCoordinates = UseCoordinates
 

Detailed Description

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
useCoordinatesToggles 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.

Member Function Documentation

◆ Evaluate()

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
VecTypeAType of first vector.
VecTypeBType of second vector.
Parameters
aFirst vector.
bSecond vector.
Returns
IoU of vectors a and b.

The documentation for this class was generated from the following files: