24.08
|
Go to the documentation of this file.
34 auto layer = CloneBase<DetectionPostProcessLayer>(graph,
m_Param,
GetName());
36 return std::move(layer);
62 if (inferredShapes.size() != 4)
65 + std::to_string(inferredShapes.size()) +
66 " element(s) - should only have 4.");
69 if (std::any_of(inferredShapes.begin(), inferredShapes.end(), [] (
auto&& inferredShape) {
70 return inferredShape.GetDimensionality() != Dimensionality::Specified;
73 throw armnn::Exception(
"One of inferredShapes' dimensionalities is not specified.");
81 "DetectionPostProcessLayer", 1);
86 "DetectionPostProcessLayer", 2);
91 "DetectionPostProcessLayer", 3);
98 std::vector<TensorShape> results;
99 results.push_back({ 1, detectedBoxes, 4 });
100 results.push_back({ 1, detectedBoxes });
101 results.push_back({ 1, detectedBoxes });
102 results.push_back({ 1 });
115 std::vector<armnn::ConstTensor> constTensors { {managedAnchors.
GetTensorInfo(), managedAnchors.
Map()} };
virtual std::unique_ptr< IWorkload > CreateWorkload(const IWorkloadFactory &factory) const override
Makes a workload for the DetectionPostProcess type.
std::vector< TensorShape > InferOutputShapes(const std::vector< TensorShape > &inputShapes) const override
The model does not specify the output shapes.
const TensorInfo & GetTensorInfo() const override
uint32_t m_MaxDetections
Maximum numbers of detections.
ImmutableConstantTensors GetConstantTensorsByRef() const override
Retrieve the handles to the constant values stored by the layer.
void ValidateAndCopyShape(const TensorShape &outputShape, const TensorShape &inferredShape, const ShapeInferenceMethod shapeInferenceMethod, const std::string &layerName, const unsigned int outputSlotIndex=0)
const OutputSlot & GetOutputSlot(unsigned int index=0) const override
Get the const output slot handle by slot index.
uint32_t m_MaxClassesPerDetection
Maximum numbers of classes per detection, used in Fast NMS.
const ConstTensorHandle * m_Anchors
const InputSlot & GetInputSlot(unsigned int index) const override
Get a const input slot handle by slot index.
const DetectionPostProcessDescriptor & GetParameters() const override
const char * GetName() const override
Returns the name of the layer.
std::vector< std::reference_wrapper< const std::shared_ptr< ConstTensorHandle > >> ImmutableConstantTensors
DetectionPostProcessDescriptor m_Param
The parameters for the layer (not including tensor-valued weights etc.).
WorkloadInfo PrepInfoAndDesc(QueueDescriptor &descriptor) const
Helper function to reduce duplication in *Layer::CreateWorkload.
unsigned int GetNumOutputSlots() const override
Returns the number of connectable output slots.
void VerifyShapeInferenceType(const TensorShape &outputShape, ShapeInferenceMethod shapeInferenceMethod)
const TensorInfo & GetTensorInfo(const ITensorHandle *tensorHandle)
float32 helpers
const void * Map(bool blocking=true)
RAII Managed resource Unmaps MemoryArea once out of scope.
void SetAdditionalInfo(QueueDescriptor &descriptor) const
Base class for all ArmNN exceptions so that users can filter to just those.
void ValidateTensorShapesFromInputs() override
Check if the input tensor shape(s) will lead to a valid configuration of DetectionPostProcessLayer.
std::shared_ptr< ConstTensorHandle > m_Anchors
A unique pointer to store Anchor values.
void ExecuteStrategy(IStrategy &strategy) const override
Apply a visitor to this layer.
const TensorShape & GetShape() const
DetectionPostProcessLayer * Clone(Graph &graph) const override
Creates a dynamically-allocated copy of this layer.
DetectionPostProcessLayer(const DetectionPostProcessDescriptor ¶m, const char *name)
Constructor to create a DetectionPostProcessLayer.
Copyright (c) 2021 ARM Limited and Contributors.
This layer represents a detection postprocess operator.
void VerifyLayerConnections(unsigned int expectedConnections, const CheckLocation &location) const
ShapeInferenceMethod m_ShapeInferenceMethod
LayerType
When adding a new layer, adapt also the LastLayer enum value in the enum class LayerType below.
virtual std::unique_ptr< IWorkload > CreateWorkload(LayerType type, const QueueDescriptor &descriptor, const WorkloadInfo &info) const =0
Backends should implement their own CreateWorkload function with a switch statement.
virtual void ExecuteStrategy(const IConnectableLayer *layer, const armnn::BaseDescriptor &descriptor, const std::vector< armnn::ConstTensor > &constants, const char *name, const armnn::LayerBindingId id=0)=0
const TensorInfo & GetTensorInfo() const
void DetectionPostProcess(const TensorInfo &boxEncodingsInfo, const TensorInfo &scoresInfo, const TensorInfo &, const TensorInfo &detectionBoxesInfo, const TensorInfo &, const TensorInfo &, const TensorInfo &, const DetectionPostProcessDescriptor &desc, Decoder< float > &boxEncodings, Decoder< float > &scores, Decoder< float > &anchors, float *detectionBoxes, float *detectionClasses, float *detectionScores, float *numDetections)