From a7acb3cbabeb66ce647684466a04c96b2963c9c9 Mon Sep 17 00:00:00 2001 From: Isabella Gottardi Date: Tue, 8 Jan 2019 13:48:44 +0000 Subject: COMPMID-1849: Implement CPPDetectionPostProcessLayer * Add DetectionPostProcessLayer * Add DetectionPostProcessLayer at the graph Change-Id: I7e56f6cffc26f112d26dfe74853085bb8ec7d849 Signed-off-by: Isabella Gottardi Reviewed-on: https://review.mlplatform.org/c/1639 Reviewed-by: Giuseppe Rossini Tested-by: Arm Jenkins --- arm_compute/graph/backends/ValidateHelpers.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'arm_compute/graph/backends/ValidateHelpers.h') diff --git a/arm_compute/graph/backends/ValidateHelpers.h b/arm_compute/graph/backends/ValidateHelpers.h index 3a5686336b..13de273bdf 100644 --- a/arm_compute/graph/backends/ValidateHelpers.h +++ b/arm_compute/graph/backends/ValidateHelpers.h @@ -228,6 +228,33 @@ Status validate_detection_output_layer(DetectionOutputLayerNode &node) return DetectionOutputLayer::validate(input0, input1, input2, output, detect_info); } +/** Validates a detection post process layer node + * + * @tparam DetectionPostProcessLayer DetectionOutput layer type + * + * @param[in] node Node to validate + * + * @return Status + */ +template +Status validate_detection_post_process_layer(DetectionPostProcessLayerNode &node) +{ + ARM_COMPUTE_LOG_GRAPH_VERBOSE("Validating DetectionPostProcessLayer node with ID : " << node.id() << " and Name: " << node.name() << std::endl); + ARM_COMPUTE_RETURN_ERROR_ON(node.num_inputs() != 3); + ARM_COMPUTE_RETURN_ERROR_ON(node.num_outputs() != 4); + + // Extract IO and info + arm_compute::ITensorInfo *input0 = get_backing_tensor_info(node.input(0)); + arm_compute::ITensorInfo *input1 = get_backing_tensor_info(node.input(1)); + arm_compute::ITensorInfo *input2 = get_backing_tensor_info(node.input(2)); + arm_compute::ITensorInfo *output0 = get_backing_tensor_info(node.output(0)); + arm_compute::ITensorInfo *output1 = get_backing_tensor_info(node.output(1)); + arm_compute::ITensorInfo *output2 = get_backing_tensor_info(node.output(2)); + arm_compute::ITensorInfo *output3 = get_backing_tensor_info(node.output(3)); + const DetectionPostProcessLayerInfo detect_info = node.detection_post_process_info(); + + return DetectionPostProcessLayer::validate(input0, input1, input2, output0, output1, output2, output3, detect_info); +} /** Validates a Generate Proposals layer node * -- cgit v1.2.1