ArmNN
 20.02
DetectionPostProcessLayer.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
9 
10 namespace armnn
11 {
12 
13 class ScopedCpuTensorHandle;
14 
15 /// This layer represents a detection postprocess operator.
16 class DetectionPostProcessLayer : public LayerWithParameters<DetectionPostProcessDescriptor>
17 {
18 public:
19  /// A unique pointer to store Anchor values.
20  std::unique_ptr<ScopedCpuTensorHandle> m_Anchors;
21 
22  /// Makes a workload for the DetectionPostProcess type.
23  /// @param [in] graph The graph where this layer can be found.
24  /// @param [in] factory The workload factory which will create the workload.
25  /// @return A pointer to the created workload, or nullptr if not created.
26  virtual std::unique_ptr<IWorkload> CreateWorkload(const IWorkloadFactory& factory) const override;
27 
28  /// Creates a dynamically-allocated copy of this layer.
29  /// @param [in] graph The graph into which this layer is being cloned.
30  DetectionPostProcessLayer* Clone(Graph& graph) const override;
31 
32  /// Check if the input tensor shape(s)
33  /// will lead to a valid configuration of @ref DetectionPostProcessLayer.
34  void ValidateTensorShapesFromInputs() override;
35 
36  void Accept(ILayerVisitor& visitor) const override;
37 
38 protected:
39  /// Constructor to create a DetectionPostProcessLayer.
40  /// @param [in] param DetectionPostProcessDescriptor to configure the detection postprocess.
41  /// @param [in] name Optional name for the layer.
42  DetectionPostProcessLayer(const DetectionPostProcessDescriptor& param, const char* name);
43 
44  /// Default destructor
45  ~DetectionPostProcessLayer() = default;
46 
47  /// Retrieve the handles to the constant values stored by the layer.
48  /// @return A vector of the constant tensors stored by this layer.
50 };
51 
52 } // namespace armnn
53 
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.
~DetectionPostProcessLayer()=default
Default destructor.
std::unique_ptr< ScopedCpuTensorHandle > m_Anchors
A unique pointer to store Anchor values.
ConstantTensors GetConstantTensorsByRef() override
Retrieve the handles to the constant values stored by the layer.
void ValidateTensorShapesFromInputs() override
Check if the input tensor shape(s) will lead to a valid configuration of DetectionPostProcessLayer.
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