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);
42 BOOST_ASSERT_MSG(
m_Anchors !=
nullptr,
"DetectionPostProcessLayer: Anchors data should not be null.");
44 BOOST_ASSERT_MSG(
GetNumOutputSlots() == 4,
"DetectionPostProcessLayer: The layer should return 4 outputs.");
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);
DetectionPostProcessLayer * Clone(Graph &graph) const override
std::unique_ptr< ScopedCpuTensorHandle > m_Anchors
A unique pointer to store Anchor values.
unsigned int GetNumOutputSlots() const override
uint32_t m_MaxClassesPerDetection
Maximum numbers of classes per detection, used in Fast NMS.
const char * GetName() const override
A tensor defined by a TensorInfo (shape and data type) and an immutable backing store.
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 void VisitDetectionPostProcessLayer(const IConnectableLayer *layer, const DetectionPostProcessDescriptor &descriptor, const ConstTensor &anchors, const char *name=nullptr)=0
This layer represents a detection postprocess operator.
virtual std::unique_ptr< IWorkload > CreateWorkload(const IWorkloadFactory &factory) const override
virtual std::unique_ptr< IWorkload > CreateDetectionPostProcess(const DetectionPostProcessQueueDescriptor &descriptor, const WorkloadInfo &info) const
std::vector< std::reference_wrapper< std::unique_ptr< ScopedCpuTensorHandle > >> ConstantTensors
void Accept(ILayerVisitor &visitor) const override
const DetectionPostProcessDescriptor & GetParameters() const
DetectionPostProcessDescriptor m_Param
The parameters for the layer (not including tensor-valued weights etc.).
ConstantTensors GetConstantTensorsByRef() override
void VerifyLayerConnections(unsigned int expectedConnections, const CheckLocation &location) const
WorkloadInfo PrepInfoAndDesc(QueueDescriptor &descriptor) const
Helper function to reduce duplication in *LayerCreateWorkload.
const ConstCpuTensorHandle * m_Anchors
DetectionPostProcessLayer(const DetectionPostProcessDescriptor ¶m, const char *name)
const TensorShape & GetShape() const
const TensorInfo & GetTensorInfo() const override
void ValidateTensorShapesFromInputs() override
const OutputSlot & GetOutputSlot(unsigned int index=0) const override
uint32_t m_MaxDetections
Maximum numbers of detections.