\section{N\+MS$<$ Use\+Coordinates $>$ Class Template Reference}
\label{classmlpack_1_1metric_1_1NMS}\index{N\+M\+S$<$ Use\+Coordinates $>$@{N\+M\+S$<$ Use\+Coordinates $>$}}


Definition of Non Maximal Supression.  


\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\textbf{ N\+MS} ()
\begin{DoxyCompactList}\small\item\em Default constructor required to satisfy the Metric policy. \end{DoxyCompactList}\item 
{\footnotesize template$<$typename Archive $>$ }\\void \textbf{ serialize} (Archive \&ar, const unsigned int)
\begin{DoxyCompactList}\small\item\em Serialize the metric. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
{\footnotesize template$<$typename Bounding\+Boxes\+Type , typename Confidence\+Score\+Type , typename Output\+Type $>$ }\\static void \textbf{ Evaluate} (const Bounding\+Boxes\+Type \&bounding\+Boxes, const Confidence\+Score\+Type \&confidence\+Scores, Output\+Type \&selected\+Indices, const double threshold=0.\+5)
\begin{DoxyCompactList}\small\item\em Performs non-\/maximal suppression. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Public Attributes}
\begin{DoxyCompactItemize}
\item 
static const bool \textbf{ use\+Coordinates} = Use\+Coordinates
\end{DoxyCompactItemize}


\subsection{Detailed Description}
\subsubsection*{template$<$bool Use\+Coordinates = false$>$\newline
class mlpack\+::metric\+::\+N\+M\+S$<$ Use\+Coordinates $>$}

Definition of Non Maximal Supression. 

Performs non-\/maximal suppression (\doxyref{N\+MS}{p.}{classmlpack_1_1metric_1_1NMS}) on the boxes according to their Intersection-\/over-\/\+Union (\doxyref{IoU}{p.}{classmlpack_1_1metric_1_1IoU}). \doxyref{N\+MS}{p.}{classmlpack_1_1metric_1_1NMS} iteratively removes lower scoring boxes which have an \doxyref{IoU}{p.}{classmlpack_1_1metric_1_1IoU} 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.


\begin{DoxyTemplParams}{Template Parameters}
{\em Use\+Coordinates} & 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. \\
\hline
\end{DoxyTemplParams}


Definition at line 40 of file non\+\_\+maximal\+\_\+supression.\+hpp.



\subsection{Constructor \& Destructor Documentation}
\mbox{\label{classmlpack_1_1metric_1_1NMS_a7d8e59faf04a83a958e2916934a67b3e}} 
\index{mlpack\+::metric\+::\+N\+MS@{mlpack\+::metric\+::\+N\+MS}!N\+MS@{N\+MS}}
\index{N\+MS@{N\+MS}!mlpack\+::metric\+::\+N\+MS@{mlpack\+::metric\+::\+N\+MS}}
\subsubsection{N\+M\+S()}
{\footnotesize\ttfamily \textbf{ N\+MS} (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Default constructor required to satisfy the Metric policy. 



Definition at line 44 of file non\+\_\+maximal\+\_\+supression.\+hpp.



References N\+M\+S$<$ Use\+Coordinates $>$\+::\+Evaluate().



\subsection{Member Function Documentation}
\mbox{\label{classmlpack_1_1metric_1_1NMS_aae1c5d8685c76ae88d8defc15e062122}} 
\index{mlpack\+::metric\+::\+N\+MS@{mlpack\+::metric\+::\+N\+MS}!Evaluate@{Evaluate}}
\index{Evaluate@{Evaluate}!mlpack\+::metric\+::\+N\+MS@{mlpack\+::metric\+::\+N\+MS}}
\subsubsection{Evaluate()}
{\footnotesize\ttfamily static void Evaluate (\begin{DoxyParamCaption}\item[{const Bounding\+Boxes\+Type \&}]{bounding\+Boxes,  }\item[{const Confidence\+Score\+Type \&}]{confidence\+Scores,  }\item[{Output\+Type \&}]{selected\+Indices,  }\item[{const double}]{threshold = {\ttfamily 0.5} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Performs non-\/maximal suppression. 


\begin{DoxyParams}{Parameters}
{\em bounding\+Boxes} & 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 Use\+Coordinates parameter. \\
\hline
{\em confidence\+Scores} & Vector containing confidence score corresponding to each bounding box. \\
\hline
{\em selected\+Indices} & Output of Non Maximal Suppression (\doxyref{N\+MS}{p.}{classmlpack_1_1metric_1_1NMS}) is stored here. It contains a list of indices corresponding to bounding boxes in input parameter, sorted in descending order of the confidence scores. \\
\hline
{\em threshold} & Threshold used to discard all overlapping bounding boxes that have \doxyref{IoU}{p.}{classmlpack_1_1metric_1_1IoU} greater than the threshold. \\
\hline
\end{DoxyParams}


Referenced by N\+M\+S$<$ Use\+Coordinates $>$\+::\+N\+M\+S().

\mbox{\label{classmlpack_1_1metric_1_1NMS_af0dd9205158ccf7bcfcd8ff81f79c927}} 
\index{mlpack\+::metric\+::\+N\+MS@{mlpack\+::metric\+::\+N\+MS}!serialize@{serialize}}
\index{serialize@{serialize}!mlpack\+::metric\+::\+N\+MS@{mlpack\+::metric\+::\+N\+MS}}
\subsubsection{serialize()}
{\footnotesize\ttfamily void serialize (\begin{DoxyParamCaption}\item[{Archive \&}]{ar,  }\item[{const unsigned}]{int }\end{DoxyParamCaption})}



Serialize the metric. 



\subsection{Member Data Documentation}
\mbox{\label{classmlpack_1_1metric_1_1NMS_a6c223cd63c9c9434b5e5fca28a8ed517}} 
\index{mlpack\+::metric\+::\+N\+MS@{mlpack\+::metric\+::\+N\+MS}!use\+Coordinates@{use\+Coordinates}}
\index{use\+Coordinates@{use\+Coordinates}!mlpack\+::metric\+::\+N\+MS@{mlpack\+::metric\+::\+N\+MS}}
\subsubsection{use\+Coordinates}
{\footnotesize\ttfamily const bool use\+Coordinates = Use\+Coordinates\hspace{0.3cm}{\ttfamily [static]}}



Definition at line 73 of file non\+\_\+maximal\+\_\+supression.\+hpp.



The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
/var/www/mlpack.\+ratml.\+org/mlpack.\+org/\+\_\+src/mlpack-\/git/src/mlpack/core/metrics/\textbf{ non\+\_\+maximal\+\_\+supression.\+hpp}\end{DoxyCompactItemize}
