MCPcopy Create free account
hub / github.com/ARM-software/armnn / ParseDetectionPostProcess

Method ParseDetectionPostProcess

src/armnnDeserializer/Deserializer.cpp:1782–1822  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1780}
1781
1782void IDeserializer::DeserializerImpl::ParseDetectionPostProcess(GraphPtr graph, unsigned int layerIndex)
1783{
1784 CHECK_LAYERS(graph, 0, layerIndex);
1785 auto inputs = GetInputs(graph, layerIndex);
1786 CHECK_LOCATION();
1787 CHECK_VALID_SIZE(inputs.size(), 2);
1788
1789 auto outputs = GetOutputs(graph, layerIndex);
1790 CHECK_VALID_SIZE(outputs.size(), 4);
1791
1792 auto flatBufferLayer = graph->layers()->Get(layerIndex)->layer_as_DetectionPostProcessLayer();
1793 auto layerName = GetLayerName(graph, layerIndex);
1794 auto flatBufferDescriptor = flatBufferLayer->descriptor();
1795
1796 armnn::DetectionPostProcessDescriptor descriptor;
1797 descriptor.m_MaxDetections = flatBufferDescriptor->maxDetections();
1798 descriptor.m_MaxClassesPerDetection = flatBufferDescriptor->maxClassesPerDetection();
1799 descriptor.m_DetectionsPerClass = flatBufferDescriptor->detectionsPerClass();
1800 descriptor.m_NmsScoreThreshold = flatBufferDescriptor->nmsScoreThreshold();
1801 descriptor.m_NmsIouThreshold = flatBufferDescriptor->nmsIouThreshold();
1802 descriptor.m_NumClasses = flatBufferDescriptor->numClasses();
1803 descriptor.m_UseRegularNms = flatBufferDescriptor->useRegularNms();
1804 descriptor.m_ScaleX = flatBufferDescriptor->scaleX();
1805 descriptor.m_ScaleY = flatBufferDescriptor->scaleY();
1806 descriptor.m_ScaleW = flatBufferDescriptor->scaleW();
1807 descriptor.m_ScaleH = flatBufferDescriptor->scaleH();
1808
1809 armnn::ConstTensor anchors = ToConstTensor(flatBufferLayer->anchors());
1810
1811 IConnectableLayer* layer = m_Network->AddDetectionPostProcessLayer(descriptor,
1812 anchors,
1813 layerName.c_str());
1814
1815 for (unsigned int i = 0; i < 4; i++)
1816 {
1817 layer->GetOutputSlot(i).SetTensorInfo(ToTensorInfo(outputs[i]));
1818 }
1819
1820 RegisterInputSlots(graph, layerIndex, layer);
1821 RegisterOutputSlots(graph, layerIndex, layer);
1822}
1823
1824void IDeserializer::DeserializerImpl::ParseDivision(GraphPtr graph, unsigned int layerIndex)
1825{

Callers

nothing calls this directly

Calls 9

ToConstTensorFunction · 0.85
GetOutputSlotMethod · 0.80
ToTensorInfoFunction · 0.70
GetLayerNameFunction · 0.50
sizeMethod · 0.45
GetMethod · 0.45
c_strMethod · 0.45
SetTensorInfoMethod · 0.45

Tested by

no test coverage detected