21.02
|
Basic function to generate proposals for a RPN (Region Proposal Network) More...
#include <CLGenerateProposalsLayer.h>
Public Member Functions | |
CLGenerateProposalsLayer (std::shared_ptr< IMemoryManager > memory_manager=nullptr) | |
Default constructor. More... | |
CLGenerateProposalsLayer (const CLGenerateProposalsLayer &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
CLGenerateProposalsLayer & | operator= (const CLGenerateProposalsLayer &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
~CLGenerateProposalsLayer () | |
Default destructor. More... | |
void | configure (const ICLTensor *scores, const ICLTensor *deltas, const ICLTensor *anchors, ICLTensor *proposals, ICLTensor *scores_out, ICLTensor *num_valid_proposals, const GenerateProposalsInfo &info) |
Set the input and output tensors. More... | |
void | configure (const CLCompileContext &compile_context, const ICLTensor *scores, const ICLTensor *deltas, const ICLTensor *anchors, ICLTensor *proposals, ICLTensor *scores_out, ICLTensor *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 CLGenerateProposalsLayer. More... | |
Basic function to generate proposals for a RPN (Region Proposal Network)
This function calls the following OpenCL kernels:
Definition at line 63 of file CLGenerateProposalsLayer.h.
CLGenerateProposalsLayer | ( | std::shared_ptr< IMemoryManager > | memory_manager = nullptr | ) |
Default constructor.
[in] | memory_manager | (Optional) Memory manager. |
Definition at line 37 of file CLGenerateProposalsLayer.cpp.
References CLGenerateProposalsLayer::~CLGenerateProposalsLayer().
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
default |
Default destructor.
Referenced by CLGenerateProposalsLayer::CLGenerateProposalsLayer().
void configure | ( | const ICLTensor * | scores, |
const ICLTensor * | deltas, | ||
const ICLTensor * | anchors, | ||
ICLTensor * | proposals, | ||
ICLTensor * | scores_out, | ||
ICLTensor * | 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 scores |
[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 72 of file CLGenerateProposalsLayer.cpp.
References CLKernelLibrary::get().
Referenced by arm_compute::test::validation::DATA_TEST_CASE().
void configure | ( | const CLCompileContext & | compile_context, |
const ICLTensor * | scores, | ||
const ICLTensor * | deltas, | ||
const ICLTensor * | anchors, | ||
ICLTensor * | proposals, | ||
ICLTensor * | scores_out, | ||
ICLTensor * | num_valid_proposals, | ||
const GenerateProposalsInfo & | info | ||
) |
Set the input and output tensors.
[in] | compile_context | The compile context to be used. |
[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 scores |
[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 78 of file CLGenerateProposalsLayer.cpp.
References CLTensorAllocator::allocate(), CLTensor::allocator(), ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_ERROR_THROW_ON, arm_compute::auto_init_if_empty(), arm_compute::CHANNEL, CLReshapeLayer::configure(), CLPermute::configure(), CPPBoxWithNonMaximaSuppressionLimit::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(), CLTensor::info(), arm_compute::test::validation::info, ITensorAllocator::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(), TensorInfo::tensor_shape(), arm_compute::U32, CLGenerateProposalsLayer::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 347 of file CLGenerateProposalsLayer.cpp.
References CLScheduler::enqueue(), CLScheduler::get(), CLReshapeLayer::run(), and CLPermute::run().
Referenced by arm_compute::test::validation::DATA_TEST_CASE().
|
static |
Static function to check if given info will lead to a valid configuration of CLGenerateProposalsLayer.
[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 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 scores |
[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 207 of file CLGenerateProposalsLayer.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, CLScheduler::get(), arm_compute::get_data_layout_dimension_index(), arm_compute::HEIGHT, GenerateProposalsInfo::im_height(), GenerateProposalsInfo::im_width(), CLTensor::map(), ICLTensor::map(), arm_compute::NCHW, arm_compute::NHWC, ITensorInfo::num_dimensions(), UniformQuantizationInfo::offset, arm_compute::QASYMM16, arm_compute::QASYMM8, arm_compute::QSYMM16, ITensorInfo::quantization_info(), CPPBoxWithNonMaximaSuppressionLimit::run(), UniformQuantizationInfo::scale, TensorInfo::set_data_type(), ITensorInfo::set_quantization_info(), GenerateProposalsInfo::spatial_scale(), ITensorInfo::total_size(), arm_compute::U32, QuantizationInfo::uniform(), CLTensor::unmap(), ICLTensor::unmap(), CLDequantizationLayerKernel::validate(), CLReshapeLayer::validate(), CLComputeAllAnchorsKernel::validate(), CLQuantizationLayerKernel::validate(), CLPadLayerKernel::validate(), CLPermute::validate(), CLBoundingBoxTransformKernel::validate(), GenerateProposalsInfo::values_per_roi(), and arm_compute::WIDTH.
Referenced by CLGenerateProposalsLayer::configure(), and arm_compute::test::validation::DATA_TEST_CASE().