21.02
|
Basic function to generate proposals for a RPN (Region Proposal Network) More...
#include <NEGenerateProposalsLayer.h>
Public Member Functions | |
NEGenerateProposalsLayer (std::shared_ptr< IMemoryManager > memory_manager=nullptr) | |
Default constructor. More... | |
NEGenerateProposalsLayer (const NEGenerateProposalsLayer &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NEGenerateProposalsLayer & | operator= (const NEGenerateProposalsLayer &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
~NEGenerateProposalsLayer () | |
Default destructor. More... | |
void | configure (const ITensor *scores, const ITensor *deltas, const ITensor *anchors, ITensor *proposals, ITensor *scores_out, ITensor *num_valid_proposals, const GenerateProposalsInfo &info) |
Set the input and output tensors. 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 *scores, const ITensorInfo *deltas, const ITensorInfo *anchors, const ITensorInfo *proposals, const ITensorInfo *scores_out, const ITensorInfo *num_valid_proposals, const GenerateProposalsInfo &info) |
Static function to check if given info will lead to a valid configuration of NEGenerateProposalsLayer. More... | |
Basic function to generate proposals for a RPN (Region Proposal Network)
This function calls the following Neon kernels:
Definition at line 58 of file NEGenerateProposalsLayer.h.
NEGenerateProposalsLayer | ( | std::shared_ptr< IMemoryManager > | memory_manager = nullptr | ) |
Default constructor.
[in] | memory_manager | (Optional) Memory manager. |
Definition at line 35 of file NEGenerateProposalsLayer.cpp.
References NEGenerateProposalsLayer::~NEGenerateProposalsLayer().
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
default |
Default destructor.
Referenced by NEGenerateProposalsLayer::NEGenerateProposalsLayer().
void configure | ( | const ITensor * | scores, |
const ITensor * | deltas, | ||
const ITensor * | anchors, | ||
ITensor * | proposals, | ||
ITensor * | scores_out, | ||
ITensor * | num_valid_proposals, | ||
const GenerateProposalsInfo & | info | ||
) |
Set the input and output tensors.
[in] | scores | Scores from convolution layer of size (W, H, A), where H and W are the height and width of the feature map, and A is the number of anchors. Data types supported: QASYMM8/F16/F32 |
[in] | deltas | Bounding box deltas from convolution layer of size (W, H, 4*A). Data types supported: Same as scores |
[in] | anchors | Anchors tensor of size (4, A). Data types supported: QSYMM16 with scale of 0.125 if scores is QASYMM8, otherwise same as scores |
[out] | proposals | Box proposals output tensor of size (5, W*H*A). Data types supported: QASYMM16 with scale of 0.125 and 0 offset if scores is QASYMM8, otherwise same as scores |
[out] | scores_out | Box scores output tensor of size (W*H*A). Data types supported: Same as input |
[out] | num_valid_proposals | Scalar output tensor which says which of the first proposals are valid. Data types supported: U32 |
[in] | info | Contains GenerateProposals operation information described in GenerateProposalsInfo |
Definition at line 70 of file NEGenerateProposalsLayer.cpp.
References TensorAllocator::allocate(), Tensor::allocator(), ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_ERROR_THROW_ON, arm_compute::auto_init_if_empty(), arm_compute::CHANNEL, NEDequantizationLayer::configure(), NEQuantizationLayer::configure(), NEBoundingBoxTransform::configure(), NEReshapeLayer::configure(), NEPermute::configure(), CPPBoxWithNonMaximaSuppressionLimit::configure(), NEPadLayer::configure(), ITensorInfo::data_layout(), ITensorInfo::data_type(), ITensorInfo::dimension(), arm_compute::F32, arm_compute::get_data_layout_dimension_index(), arm_compute::HEIGHT, GenerateProposalsInfo::im_height(), GenerateProposalsInfo::im_scale(), GenerateProposalsInfo::im_width(), ITensor::info(), Tensor::info(), arm_compute::test::validation::info, TensorAllocator::init(), arm_compute::LINEAR, MemoryGroup::manage(), GenerateProposalsInfo::min_size(), arm_compute::NHWC, GenerateProposalsInfo::nms_thres(), GenerateProposalsInfo::post_nms_topN(), GenerateProposalsInfo::pre_nms_topN(), arm_compute::QASYMM16, arm_compute::QASYMM8, ITensorInfo::quantization_info(), GenerateProposalsInfo::spatial_scale(), ITensorInfo::tensor_shape(), arm_compute::U32, NEGenerateProposalsLayer::validate(), GenerateProposalsInfo::values_per_roi(), and arm_compute::WIDTH.
|
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 322 of file NEGenerateProposalsLayer.cpp.
References Window::DimY, Scheduler::get(), INESimpleFunctionNoBorder::run(), NEReshapeLayer::run(), NEPermute::run(), CPPBoxWithNonMaximaSuppressionLimit::run(), NEPadLayer::run(), and IScheduler::schedule().
|
static |
Static function to check if given info will lead to a valid configuration of NEGenerateProposalsLayer.
[in] | scores | Scores info from convolution layer of size (W, H, A), where H and W are the height and width of the feature map, and A is the number of anchors. Data types supported: QASYMM8/F16/F32 |
[in] | deltas | Bounding box deltas info from convolution layer of size (W, H, 4*A). Data types supported: Same as scores |
[in] | anchors | Anchors tensor info of size (4, A). Data types supported: QSYMM16 with scale of 0.125 if scores is QASYMM8, otherwise same as scores |
[in] | proposals | Box proposals info output tensor of size (5, W*H*A). Data types supported: QASYMM16 with scale of 0.125 and 0 offset if scores is QASYMM8, otherwise same as scores |
[in] | scores_out | Box scores output tensor info of size (W*H*A). Data types supported: Same as input |
[in] | num_valid_proposals | Scalar output tensor info which says which of the first proposals are valid. Data types supported: U32 |
[in] | info | Contains GenerateProposals operation information described in GenerateProposalsInfo |
Definition at line 210 of file NEGenerateProposalsLayer.cpp.
References ARM_COMPUTE_RETURN_ERROR_ON, ARM_COMPUTE_RETURN_ERROR_ON_DATA_LAYOUT_NOT_IN, ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN, ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_LAYOUT, ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES, ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_SHAPES, ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR, ARM_COMPUTE_RETURN_ON_ERROR, arm_compute::CHANNEL, ICloneable< T >::clone(), ITensorInfo::data_layout(), ITensorInfo::data_type(), ITensorInfo::dimension(), arm_compute::F16, arm_compute::F32, arm_compute::get_data_layout_dimension_index(), arm_compute::HEIGHT, GenerateProposalsInfo::im_height(), GenerateProposalsInfo::im_width(), arm_compute::NCHW, arm_compute::NHWC, ITensorInfo::num_dimensions(), UniformQuantizationInfo::offset, arm_compute::QASYMM16, arm_compute::QASYMM8, arm_compute::QSYMM16, ITensorInfo::quantization_info(), UniformQuantizationInfo::scale, TensorInfo::set_data_type(), ITensorInfo::set_quantization_info(), GenerateProposalsInfo::spatial_scale(), ITensorInfo::total_size(), arm_compute::U32, QuantizationInfo::uniform(), NEDequantizationLayer::validate(), NEQuantizationLayer::validate(), NEReshapeLayer::validate(), NEBoundingBoxTransform::validate(), NEComputeAllAnchorsKernel::validate(), NEPermute::validate(), NEPadLayer::validate(), GenerateProposalsInfo::values_per_roi(), and arm_compute::WIDTH.
Referenced by NEGenerateProposalsLayer::configure().