NonMaximumSuppression Class Reference

NonMaximumSuppression Class Reference#

3 min read time

Applies to Linux

rocCV: roccv::NonMaximumSuppression Class Reference
roccv::NonMaximumSuppression Class Referencefinal

Class for managing the NMS operator. More...

#include <op_non_max_suppression.hpp>

Inheritance diagram for roccv::NonMaximumSuppression:
roccv::IOperator

Public Member Functions

 NonMaximumSuppression ()
 Construct a new Op Non Max Suppression object. More...
 
void operator() (hipStream_t stream, const Tensor &input, const Tensor &output, const Tensor &scores, float scoreThreshold, float iouThreshold, const eDeviceType device=eDeviceType::GPU) const
 Executes the Non-Maximum Suppression operation. This object performs Non-Maximum Suppression on bounding boxes based on scores a score threshold, and an IoU threshold. More...
 
 ~NonMaximumSuppression ()
 Destroy the Op Non Max Suppression object. More...
 
- Public Member Functions inherited from roccv::IOperator
virtual ~IOperator ()
 

Detailed Description

Class for managing the NMS operator.

Constructor & Destructor Documentation

◆ NonMaximumSuppression()

roccv::NonMaximumSuppression::NonMaximumSuppression ( )
inline

Construct a new Op Non Max Suppression object.

◆ ~NonMaximumSuppression()

roccv::NonMaximumSuppression::~NonMaximumSuppression ( )
inline

Destroy the Op Non Max Suppression object.

Member Function Documentation

◆ operator()()

void roccv::NonMaximumSuppression::operator() ( hipStream_t  stream,
const Tensor input,
const Tensor output,
const Tensor scores,
float  scoreThreshold,
float  iouThreshold,
const eDeviceType  device = eDeviceType::GPU 
) const

Executes the Non-Maximum Suppression operation. This object performs Non-Maximum Suppression on bounding boxes based on scores a score threshold, and an IoU threshold.

Limitations:

Input: Supported TensorLayout(s): [NW, NWC] Supported DataType(s): [4S16, S16]

Scores: Supported TensorLayout(s): [NW, NWC] Supported DataType(s): [F32]

Output: Supported TensorLayout(s): [NW, NWC] Supported DataType(s): [U8]

IoU Threshold: Range: (0.0, 1.0)

Input/Output Dependency:

  Property      |  Input == Output == Scores
 -------------- | -------------
  TensorLayout  | No
  DataType      | No
  Channels      | No
  Width         | Yes
  Height        | No
  Batch         | Yes
Parameters
[in]streamThe HIP stream to run this operator on.
[in]inputBatches of input boxes in the shape NW where N is the number of batches and W is the number of boxes per batch. If using layout NW, datatype must be 4S16. Boxes are structured in memory as a short4 with (x=x, y=y, z=width, w=height). If using layout NWC, datatype must be S16 with the final shape dimension being 4.
[out]outputOutput tensor is the output boolean mask which marks boxes as either kept (1) or suppressed (0). If using NWC layout, the final shape dimension must be 1. The number of batches N and boxes per batch W must match with the given input tensor.
[in]scoresA Tensor containing the confidence scores for each box. If using layout NWC, the final shape dimension must be 1. The number of batches N and boxes per batch W must match with the given input tensor.
[in]scoreThresholdThe minimum score a box must have in order to be kept.
[in]iouThresholdIoU threshold to filter overlapping boxes.
[in]deviceThe device to run this operator on. (Default: GPU)

The documentation for this class was generated from the following file:
  • /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-roccv/checkouts/latest/include/op_non_max_suppression.hpp