Definition of Non Maximal Supression. More...
Public Member Functions | |
NMS () | |
Default constructor required to satisfy the Metric policy. More... | |
template < typename Archive > | |
void | serialize (Archive &ar, const uint32_t) |
Serialize the metric. More... | |
Static Public Member Functions | |
template < typename BoundingBoxesType , typename ConfidenceScoreType , typename OutputType > | |
static void | Evaluate (const BoundingBoxesType &boundingBoxes, const ConfidenceScoreType &confidenceScores, OutputType &selectedIndices, const double threshold=0.5) |
Performs non-maximal suppression. More... | |
Static Public Attributes | |
static const bool | useCoordinates = UseCoordinates |
Definition of Non Maximal Supression.
Performs non-maximal suppression (NMS) on the boxes according to their Intersection-over-Union (IoU). NMS iteratively removes lower scoring boxes which have an IoU greater than threshold with another high scoring box.
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.
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. |
Definition at line 40 of file non_maximal_supression.hpp.
|
inline |
Default constructor required to satisfy the Metric policy.
Definition at line 44 of file non_maximal_supression.hpp.
References NMS< UseCoordinates >::Evaluate().
|
static |
Performs non-maximal suppression.
boundingBoxes | Column major representation of bounding boxes i.e. Each column corresponds to a different bounding box. Each bounding box should contain 4 points only either {x1, y1, x2, y2} or {x1, y1, h, w} depending on UseCoordinates parameter. |
confidenceScores | Vector containing confidence score corresponding to each bounding box. |
selectedIndices | Output of Non Maximal Suppression (NMS) is stored here. It contains a list of indices corresponding to bounding boxes in input parameter, sorted in descending order of the confidence scores. |
threshold | Threshold used to discard all overlapping bounding boxes that have IoU greater than the threshold. |
Referenced by NMS< UseCoordinates >::NMS().
void serialize | ( | Archive & | ar, |
const uint32_t | |||
) |
Serialize the metric.
|
static |
Definition at line 73 of file non_maximal_supression.hpp.