21.02
|
CPP Function to generate the detection output based on center size encoded boxes, class prediction and anchors by doing non maximum suppression. More...
#include <CPPDetectionPostProcessLayer.h>
Public Member Functions | |
CPPDetectionPostProcessLayer (std::shared_ptr< IMemoryManager > memory_manager=nullptr) | |
Constructor. More... | |
CPPDetectionPostProcessLayer (const CPPDetectionPostProcessLayer &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
CPPDetectionPostProcessLayer & | operator= (const CPPDetectionPostProcessLayer &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
void | configure (const ITensor *input_box_encoding, const ITensor *input_score, const ITensor *input_anchors, ITensor *output_boxes, ITensor *output_classes, ITensor *output_scores, ITensor *num_detection, DetectionPostProcessLayerInfo info=DetectionPostProcessLayerInfo()) |
Configure the detection output layer CPP function. More... | |
void | run () override |
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 *input_box_encoding, const ITensorInfo *input_class_score, const ITensorInfo *input_anchors, ITensorInfo *output_boxes, ITensorInfo *output_classes, ITensorInfo *output_scores, ITensorInfo *num_detection, DetectionPostProcessLayerInfo info=DetectionPostProcessLayerInfo()) |
Static function to check if given info will lead to a valid configuration of CPPDetectionPostProcessLayer. More... | |
CPP Function to generate the detection output based on center size encoded boxes, class prediction and anchors by doing non maximum suppression.
Definition at line 46 of file CPPDetectionPostProcessLayer.h.
CPPDetectionPostProcessLayer | ( | std::shared_ptr< IMemoryManager > | memory_manager = nullptr | ) |
Constructor.
Definition at line 209 of file CPPDetectionPostProcessLayer.cpp.
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
void configure | ( | const ITensor * | input_box_encoding, |
const ITensor * | input_score, | ||
const ITensor * | input_anchors, | ||
ITensor * | output_boxes, | ||
ITensor * | output_classes, | ||
ITensor * | output_scores, | ||
ITensor * | num_detection, | ||
DetectionPostProcessLayerInfo | info = DetectionPostProcessLayerInfo() |
||
) |
Configure the detection output layer CPP function.
[in] | input_box_encoding | The bounding box input tensor. Data types supported: F32/QASYMM8/QASYMM8_SIGNED. |
[in] | input_score | The class prediction input tensor. Data types supported: Same as input_box_encoding . |
[in] | input_anchors | The anchors input tensor. Data types supported: Same as input_box_encoding . |
[out] | output_boxes | The boxes output tensor. Data types supported: F32. |
[out] | output_classes | The classes output tensor. Data types supported: Same as output_boxes . |
[out] | output_scores | The scores output tensor. Data types supported: Same as output_boxes . |
[out] | num_detection | The number of output detection. Data types supported: Same as output_boxes . |
[in] | info | (Optional) DetectionPostProcessLayerInfo information. |
Definition at line 216 of file CPPDetectionPostProcessLayer.cpp.
References TensorAllocator::allocate(), Tensor::allocator(), ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_ERROR_THROW_ON, arm_compute::auto_init_if_empty(), CPPNonMaximumSuppression::configure(), ITensorInfo::data_type(), DetectionPostProcessLayerInfo::dequantize_scores(), DetectionPostProcessLayerInfo::detection_per_class(), ITensorInfo::dimension(), arm_compute::F32, ITensor::info(), Tensor::info(), arm_compute::test::validation::info, DetectionPostProcessLayerInfo::iou_threshold(), arm_compute::is_data_type_quantized(), MemoryGroup::manage(), DetectionPostProcessLayerInfo::max_classes_per_detection(), DetectionPostProcessLayerInfo::max_detections(), DetectionPostProcessLayerInfo::nms_score_threshold(), DetectionPostProcessLayerInfo::num_classes(), arm_compute::S32, arm_compute::U, DetectionPostProcessLayerInfo::use_regular_nms(), and arm_compute::validate_arguments().
Referenced by NEDetectionPostProcessLayer::configure().
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
overridevirtual |
Run the kernels contained in the function.
For Neon kernels:
For OpenCL kernels:
Implements IFunction.
Definition at line 282 of file CPPDetectionPostProcessLayer.cpp.
References arm_compute::test::validation::b, Tensor::buffer(), ITensorInfo::data_type(), arm_compute::dequantize_qasymm8(), arm_compute::dequantize_qasymm8_signed(), DetectionPostProcessLayerInfo::detection_per_class(), ITensor::info(), DetectionPostProcessLayerInfo::max_classes_per_detection(), DetectionPostProcessLayerInfo::max_detections(), DetectionPostProcessLayerInfo::num_classes(), ITensor::ptr_to_element(), arm_compute::QASYMM8, arm_compute::QASYMM8_SIGNED, ITensorInfo::quantization_info(), ICPPSimpleFunction::run(), and DetectionPostProcessLayerInfo::use_regular_nms().
Referenced by NEDetectionPostProcessLayer::run().
|
static |
Static function to check if given info will lead to a valid configuration of CPPDetectionPostProcessLayer.
[in] | input_box_encoding | The bounding box input tensor info. Data types supported: F32/QASYMM8/QASYMM8_SIGNED. |
[in] | input_class_score | The class prediction input tensor info. Data types supported: Same as input_box_encoding . |
[in] | input_anchors | The anchors input tensor. Data types supported: F32, QASYMM8. |
[out] | output_boxes | The output tensor. Data types supported: F32. |
[out] | output_classes | The output tensor. Data types supported: Same as output_boxes . |
[out] | output_scores | The output tensor. Data types supported: Same as output_boxes . |
[out] | num_detection | The number of output detection. Data types supported: Same as output_boxes . |
[in] | info | (Optional) DetectionPostProcessLayerInfo information. |
Definition at line 266 of file CPPDetectionPostProcessLayer.cpp.
References ARM_COMPUTE_RETURN_ON_ERROR, ITensorInfo::dimension(), arm_compute::F32, DetectionPostProcessLayerInfo::iou_threshold(), DetectionPostProcessLayerInfo::max_detections(), DetectionPostProcessLayerInfo::nms_score_threshold(), arm_compute::S32, CPPNonMaximumSuppression::validate(), and arm_compute::validate_arguments().
Referenced by arm_compute::test::validation::DATA_TEST_CASE(), and NEDetectionPostProcessLayer::validate().