Compute Library
 21.11
CPPNonMaximumSuppression Class Reference

CPP Function to perform non maximum suppression on the bounding boxes and scores. More...

#include <CPPNonMaximumSuppression.h>

Collaboration diagram for CPPNonMaximumSuppression:
[legend]

Public Member Functions

void configure (const ITensor *bboxes, const ITensor *scores, ITensor *indices, unsigned int max_output_size, const float score_threshold, const float nms_threshold)
 Configure the function to perform non maximal suppression. More...
 
- Public Member Functions inherited from ICPPSimpleFunction
 ICPPSimpleFunction ()
 Constructor. More...
 
void run () override final
 Run the kernels contained in the function. More...
 
- Public Member Functions inherited from IFunction
virtual ~IFunction ()=default
 Destructor. More...
 
virtual void prepare ()
 Prepare the function for executing. More...
 

Static Public Member Functions

static Status validate (const ITensorInfo *bboxes, const ITensorInfo *scores, const ITensorInfo *indices, unsigned int max_output_size, const float score_threshold, const float nms_threshold)
 Static function to check if given arguments will lead to a valid configuration of CPPNonMaximumSuppression. More...
 

Detailed Description

CPP Function to perform non maximum suppression on the bounding boxes and scores.

Definition at line 38 of file CPPNonMaximumSuppression.h.

Member Function Documentation

◆ configure()

void configure ( const ITensor bboxes,
const ITensor scores,
ITensor indices,
unsigned int  max_output_size,
const float  score_threshold,
const float  nms_threshold 
)

Configure the function to perform non maximal suppression.

Parameters
[in]bboxesThe input bounding boxes. Data types supported: F32.
[in]scoresThe corresponding input confidence. Same as bboxes.
[out]indicesThe kept indices of bboxes after nms. Data types supported: S32.
[in]max_output_sizeAn integer tensor representing the maximum number of boxes to be selected by non max suppression.
[in]score_thresholdThe threshold used to filter detection results.
[in]nms_thresholdThe threshold used in non maximum suppression.

Definition at line 32 of file CPPNonMaximumSuppression.cpp.

References ARM_COMPUTE_LOG_PARAMS, and arm_compute::test::validation::k.

Referenced by CPPDetectionPostProcessLayer::configure().

35 {
36  ARM_COMPUTE_LOG_PARAMS(bboxes, scores, indices, max_output_size, score_threshold, nms_threshold);
37 
38  auto k = std::make_unique<CPPNonMaximumSuppressionKernel>();
39  k->configure(bboxes, scores, indices, max_output_size, score_threshold, nms_threshold);
40  _kernel = std::move(k);
41 }
#define ARM_COMPUTE_LOG_PARAMS(...)

◆ validate()

Status validate ( const ITensorInfo bboxes,
const ITensorInfo scores,
const ITensorInfo indices,
unsigned int  max_output_size,
const float  score_threshold,
const float  nms_threshold 
)
static

Static function to check if given arguments will lead to a valid configuration of CPPNonMaximumSuppression.

Parameters
[in]bboxesThe input bounding boxes tensor info. Data types supported: F32.
[in]scoresThe corresponding input confidence tensor info. Same as bboxes.
[out]indicesThe kept indices of bboxes after nms tensor info. Data types supported: S32.
[in]max_output_sizeAn integer tensor representing the maximum number of boxes to be selected by non max suppression.
[in]score_thresholdThe threshold used to filter detection results.
[in]nms_thresholdThe threshold used in non maximum suppression.

Definition at line 43 of file CPPNonMaximumSuppression.cpp.

References CPPNonMaximumSuppressionKernel::validate().

Referenced by arm_compute::test::validation::DATA_TEST_CASE(), and CPPDetectionPostProcessLayer::validate().

46 {
47  return CPPNonMaximumSuppressionKernel::validate(bboxes, scores, indices, max_output_size, score_threshold, nms_threshold);
48 }
static Status validate(const ITensorInfo *input_bboxes, const ITensorInfo *input_scores, const ITensorInfo *output_indices, unsigned int max_output_size, const float score_threshold, const float iou_threshold)
Static function to check if given arguments will lead to a valid configuration of CPPNonMaximumSuppre...

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