From 0e2bab81442ee6cc2b94e4f7881ed0c5c6af65e7 Mon Sep 17 00:00:00 2001 From: Jim Flynn Date: Thu, 19 Mar 2020 17:03:14 +0000 Subject: Creating gh-pages documentation for ArmNN Signed-off-by: Jim Flynn --- ..._detection_post_process_layer_8cpp_source.xhtml | 154 +++++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 Documentation/_detection_post_process_layer_8cpp_source.xhtml (limited to 'Documentation/_detection_post_process_layer_8cpp_source.xhtml') diff --git a/Documentation/_detection_post_process_layer_8cpp_source.xhtml b/Documentation/_detection_post_process_layer_8cpp_source.xhtml new file mode 100644 index 0000000000..91c141803f --- /dev/null +++ b/Documentation/_detection_post_process_layer_8cpp_source.xhtml @@ -0,0 +1,154 @@ + + + + + + + + + + + + + +ArmNN: src/armnn/layers/DetectionPostProcessLayer.cpp Source File + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  20.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
DetectionPostProcessLayer.cpp
+
+
+Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
7 
8 #include "LayerCloneBase.hpp"
9 
10 #include <armnn/TypesUtils.hpp>
14 
15 namespace armnn
16 {
17 
20 {
21 }
22 
23 std::unique_ptr<IWorkload> DetectionPostProcessLayer::CreateWorkload(const armnn::IWorkloadFactory& factory) const
24 {
26  descriptor.m_Anchors = m_Anchors.get();
27  return factory.CreateDetectionPostProcess(descriptor, PrepInfoAndDesc(descriptor));
28 }
29 
31 {
32  auto layer = CloneBase<DetectionPostProcessLayer>(graph, m_Param, GetName());
33  layer->m_Anchors = m_Anchors ? std::make_unique<ScopedCpuTensorHandle>(*m_Anchors) : nullptr;
34  return std::move(layer);
35 }
36 
38 {
40 
41  // on this level constant data should not be released.
42  BOOST_ASSERT_MSG(m_Anchors != nullptr, "DetectionPostProcessLayer: Anchors data should not be null.");
43 
44  BOOST_ASSERT_MSG(GetNumOutputSlots() == 4, "DetectionPostProcessLayer: The layer should return 4 outputs.");
45 
46  unsigned int detectedBoxes = m_Param.m_MaxDetections * m_Param.m_MaxClassesPerDetection;
47 
48  const TensorShape& inferredDetectionBoxes = TensorShape({ 1, detectedBoxes, 4 });
49  const TensorShape& inferredDetectionScores = TensorShape({ 1, detectedBoxes });
50  const TensorShape& inferredNumberDetections = TensorShape({ 1 });
51 
52  ConditionalThrowIfNotEqual<LayerValidationException>(
53  "DetectionPostProcessLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.",
55  inferredDetectionBoxes);
56  ConditionalThrowIfNotEqual<LayerValidationException>(
57  "DetectionPostProcessLayer: TensorShape set on OutputSlot[1] does not match the inferred shape.",
59  inferredDetectionScores);
60  ConditionalThrowIfNotEqual<LayerValidationException>(
61  "DetectionPostProcessLayer: TensorShape set on OutputSlot[2] does not match the inferred shape.",
63  inferredDetectionScores);
64  ConditionalThrowIfNotEqual<LayerValidationException>(
65  "DetectionPostProcessLayer: TensorShape set on OutputSlot[3] does not match the inferred shape.",
67  inferredNumberDetections);
68 }
69 
71 {
72  return { m_Anchors };
73 }
74 
76 {
77  ConstTensor anchorTensor(m_Anchors->GetTensorInfo(), m_Anchors->GetConstTensor<void>());
78  visitor.VisitDetectionPostProcessLayer(this, GetParameters(), anchorTensor, GetName());
79 }
80 
81 } // namespace armnn
+
DetectionPostProcessDescriptor m_Param
The parameters for the layer (not including tensor-valued weights etc.).
+
const DetectionPostProcessDescriptor & GetParameters() const
+
const TensorShape & GetShape() const
Definition: Tensor.hpp:88
+
+ + +
virtual std::unique_ptr< IWorkload > CreateWorkload(const IWorkloadFactory &factory) const override
Makes a workload for the DetectionPostProcess type.
+
DetectionPostProcessLayer(const DetectionPostProcessDescriptor &param, const char *name)
Constructor to create a DetectionPostProcessLayer.
+
void Accept(ILayerVisitor &visitor) const override
Apply a visitor to this layer.
+
This layer represents a detection postprocess operator.
+
Copyright (c) 2020 ARM Limited.
+ +
unsigned int GetNumOutputSlots() const override
Returns the number of connectable output slots.
Definition: Layer.hpp:308
+
uint32_t m_MaxClassesPerDetection
Maximum numbers of classes per detection, used in Fast NMS.
+
void VerifyLayerConnections(unsigned int expectedConnections, const CheckLocation &location) const
Definition: Layer.cpp:338
+
+
uint32_t m_MaxDetections
Maximum numbers of detections.
+ +
void DetectionPostProcess(const TensorInfo &boxEncodingsInfo, const TensorInfo &scoresInfo, const TensorInfo &anchorsInfo, const TensorInfo &detectionBoxesInfo, const TensorInfo &detectionClassesInfo, const TensorInfo &detectionScoresInfo, const TensorInfo &numDetectionsInfo, const DetectionPostProcessDescriptor &desc, Decoder< float > &boxEncodings, Decoder< float > &scores, Decoder< float > &anchors, float *detectionBoxes, float *detectionClasses, float *detectionScores, float *numDetections)
+
virtual std::unique_ptr< IWorkload > CreateDetectionPostProcess(const DetectionPostProcessQueueDescriptor &descriptor, const WorkloadInfo &info) const
+
std::unique_ptr< ScopedCpuTensorHandle > m_Anchors
A unique pointer to store Anchor values.
+
A tensor defined by a TensorInfo (shape and data type) and an immutable backing store.
Definition: Tensor.hpp:199
+
const ConstCpuTensorHandle * m_Anchors
+
ConstantTensors GetConstantTensorsByRef() override
Retrieve the handles to the constant values stored by the layer.
+
#define CHECK_LOCATION()
Definition: Exceptions.hpp:192
+ + +
void ValidateTensorShapesFromInputs() override
Check if the input tensor shape(s) will lead to a valid configuration of DetectionPostProcessLayer.
+
WorkloadInfo PrepInfoAndDesc(QueueDescriptor &descriptor) const
Helper function to reduce duplication in *LayerCreateWorkload.
+ +
const OutputSlot & GetOutputSlot(unsigned int index=0) const override
Get the const output slot handle by slot index.
Definition: Layer.hpp:312
+
const char * GetName() const override
Returns the name of the layer.
Definition: Layer.hpp:305
+ +
DetectionPostProcessLayer * Clone(Graph &graph) const override
Creates a dynamically-allocated copy of this layer.
+
std::vector< std::reference_wrapper< std::unique_ptr< ScopedCpuTensorHandle > >> ConstantTensors
Definition: Layer.hpp:363
+
+
virtual void VisitDetectionPostProcessLayer(const IConnectableLayer *layer, const DetectionPostProcessDescriptor &descriptor, const ConstTensor &anchors, const char *name=nullptr)=0
Function that a Detection PostProcess layer should call back to when its Accept(ILayerVisitor&) funct...
+
const TensorInfo & GetTensorInfo() const override
Definition: Layer.cpp:63
+ + +
+
+ + + + -- cgit v1.2.1