21.02
|
CPP kernel to perform computation of BoxWithNonMaximaSuppressionLimit. More...
#include <CPPBoxWithNonMaximaSuppressionLimitKernel.h>
Public Member Functions | |
const char * | name () const override |
Name of the kernel. More... | |
CPPBoxWithNonMaximaSuppressionLimitKernel () | |
Default constructor. More... | |
CPPBoxWithNonMaximaSuppressionLimitKernel (const CPPBoxWithNonMaximaSuppressionLimitKernel &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
CPPBoxWithNonMaximaSuppressionLimitKernel & | operator= (const CPPBoxWithNonMaximaSuppressionLimitKernel &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
CPPBoxWithNonMaximaSuppressionLimitKernel (CPPBoxWithNonMaximaSuppressionLimitKernel &&)=default | |
Allow instances of this class to be moved. More... | |
CPPBoxWithNonMaximaSuppressionLimitKernel & | operator= (CPPBoxWithNonMaximaSuppressionLimitKernel &&)=default |
Allow instances of this class to be moved. More... | |
void | configure (const ITensor *scores_in, const ITensor *boxes_in, const ITensor *batch_splits_in, ITensor *scores_out, ITensor *boxes_out, ITensor *classes, ITensor *batch_splits_out=nullptr, ITensor *keeps=nullptr, ITensor *keeps_size=nullptr, const BoxNMSLimitInfo info=BoxNMSLimitInfo()) |
Initialise the kernel's input and output tensors. More... | |
void | run (const Window &window, const ThreadInfo &info) override |
Execute the kernel on the passed window. More... | |
bool | is_parallelisable () const override |
Indicates whether or not the kernel is parallelisable. More... | |
template<typename T > | |
void | run_nmslimit () |
Public Member Functions inherited from ICPPKernel | |
virtual | ~ICPPKernel ()=default |
Default destructor. More... | |
virtual void | run_nd (const Window &window, const ThreadInfo &info, const Window &thread_locator) |
legacy compatibility layer for implemantions which do not support thread_locator In these cases we simply narrow the interface down the legacy version More... | |
virtual void | run_op (ITensorPack &tensors, const Window &window, const ThreadInfo &info) |
Execute the kernel on the passed window. More... | |
Public Member Functions inherited from IKernel | |
IKernel () | |
Constructor. More... | |
virtual | ~IKernel ()=default |
Destructor. More... | |
virtual BorderSize | border_size () const |
The size of the border for that kernel. More... | |
const Window & | window () const |
The maximum window the kernel can be executed on. More... | |
CPP kernel to perform computation of BoxWithNonMaximaSuppressionLimit.
Definition at line 35 of file CPPBoxWithNonMaximaSuppressionLimitKernel.h.
Default constructor.
Definition at line 186 of file CPPBoxWithNonMaximaSuppressionLimitKernel.cpp.
Referenced by CPPBoxWithNonMaximaSuppressionLimitKernel::name().
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
Allow instances of this class to be moved.
void configure | ( | const ITensor * | scores_in, |
const ITensor * | boxes_in, | ||
const ITensor * | batch_splits_in, | ||
ITensor * | scores_out, | ||
ITensor * | boxes_out, | ||
ITensor * | classes, | ||
ITensor * | batch_splits_out = nullptr , |
||
ITensor * | keeps = nullptr , |
||
ITensor * | keeps_size = nullptr , |
||
const BoxNMSLimitInfo | info = BoxNMSLimitInfo() |
||
) |
Initialise the kernel's input and output tensors.
[in] | scores_in | The scores input tensor of size [num_classes, count]. Data types supported: F16/F32 |
[in] | boxes_in | The boxes input tensor of size [num_classes * 4, count]. Data types supported: Same as scores_in |
[in] | batch_splits_in | The batch splits input tensor of size [batch_size]. Data types supported: Same as scores_in |
scores_in
and boxes_in
have items from multiple images. [out] | scores_out | The scores output tensor of size [N]. Data types supported: Same as scores_in |
[out] | boxes_out | The boxes output tensor of size [4, N]. Data types supported: Same as scores_in |
[out] | classes | The classes output tensor of size [N]. Data types supported: Same as scores_in |
[out] | batch_splits_out | (Optional) The batch splits output tensor [batch_size]. Data types supported: Same as scores_in |
[out] | keeps | (Optional) The keeps output tensor of size [N]. Data types supported: Same asscores_in |
[out] | keeps_size | (Optional) Number of filtered indices per class tensor of size [num_classes]. Data types supported: U32 |
[in] | info | (Optional) BoxNMSLimitInfo information. |
Definition at line 349 of file CPPBoxWithNonMaximaSuppressionLimitKernel.cpp.
References ARM_COMPUTE_ERROR_ON, ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN, ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_TYPES, ARM_COMPUTE_ERROR_ON_MSG, ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_UNUSED, arm_compute::calculate_max_window(), ITensorInfo::dimension(), arm_compute::F16, arm_compute::F32, ITensor::info(), arm_compute::test::validation::info, and arm_compute::U32.
Referenced by CPPBoxWithNonMaximaSuppressionLimit::configure(), and CPPBoxWithNonMaximaSuppressionLimitKernel::name().
|
overridevirtual |
Indicates whether or not the kernel is parallelisable.
If the kernel is parallelisable then the window returned by window() can be split into sub-windows which can then be run in parallel.
If the kernel is not parallelisable then only the window returned by window() can be passed to run()
Reimplemented from IKernel.
Definition at line 192 of file CPPBoxWithNonMaximaSuppressionLimitKernel.cpp.
Referenced by CPPBoxWithNonMaximaSuppressionLimitKernel::name().
|
inlineoverridevirtual |
Name of the kernel.
Implements ICPPKernel.
Definition at line 38 of file CPPBoxWithNonMaximaSuppressionLimitKernel.h.
References CPPBoxWithNonMaximaSuppressionLimitKernel::configure(), CPPBoxWithNonMaximaSuppressionLimitKernel::CPPBoxWithNonMaximaSuppressionLimitKernel(), arm_compute::test::validation::info, CPPBoxWithNonMaximaSuppressionLimitKernel::is_parallelisable(), CPPBoxWithNonMaximaSuppressionLimitKernel::operator=(), CPPBoxWithNonMaximaSuppressionLimitKernel::run(), CPPBoxWithNonMaximaSuppressionLimitKernel::run_nmslimit(), and IKernel::window().
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
Referenced by CPPBoxWithNonMaximaSuppressionLimitKernel::name().
|
default |
Allow instances of this class to be moved.
|
overridevirtual |
Execute the kernel on the passed window.
[in] | window | Region on which to execute the kernel. (Must be a region of the window returned by window()) |
[in] | info | Info about executing thread and CPU. |
Reimplemented from ICPPKernel.
Definition at line 398 of file CPPBoxWithNonMaximaSuppressionLimitKernel.cpp.
References ARM_COMPUTE_ERROR, ARM_COMPUTE_ERROR_ON_MISMATCHING_WINDOWS, ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL, ARM_COMPUTE_UNUSED, ITensorInfo::data_type(), arm_compute::F16, arm_compute::F32, ITensor::info(), and IKernel::window().
Referenced by CPPBoxWithNonMaximaSuppressionLimitKernel::name().
void run_nmslimit | ( | ) |
Definition at line 198 of file CPPBoxWithNonMaximaSuppressionLimitKernel.cpp.
References arm_compute::test::validation::b, BoxNMSLimitInfo::detections_per_im(), ITensorInfo::dimension(), ITensor::info(), offset(), ITensor::ptr_to_element(), BoxNMSLimitInfo::score_thresh(), and BoxNMSLimitInfo::soft_nms_enabled().
Referenced by CPPBoxWithNonMaximaSuppressionLimitKernel::name().