| 463 | } |
| 464 | |
| 465 | NodeID GraphBuilder::add_detection_post_process_node(Graph &g, |
| 466 | NodeParams params, |
| 467 | NodeIdxPair input_box_encoding, |
| 468 | NodeIdxPair input_class_prediction, |
| 469 | const DetectionPostProcessLayerInfo &detect_info, |
| 470 | ITensorAccessorUPtr anchors_accessor, |
| 471 | const QuantizationInfo &anchor_quant_info) |
| 472 | { |
| 473 | check_nodeidx_pair(input_box_encoding, g); |
| 474 | check_nodeidx_pair(input_class_prediction, g); |
| 475 | |
| 476 | // Get input tensor descriptor |
| 477 | const TensorDescriptor input_box_encoding_tensor_desc = |
| 478 | get_tensor_descriptor(g, g.node(input_box_encoding.node_id)->outputs()[0]); |
| 479 | |
| 480 | // Calculate anchor descriptor |
| 481 | TensorDescriptor anchor_desc = input_box_encoding_tensor_desc; |
| 482 | if (!anchor_quant_info.empty()) |
| 483 | { |
| 484 | anchor_desc.quant_info = anchor_quant_info; |
| 485 | } |
| 486 | |
| 487 | // Create anchors nodes |
| 488 | auto anchors_nid = add_const_node_with_name(g, params, "Anchors", anchor_desc, std::move(anchors_accessor)); |
| 489 | |
| 490 | // Create detection_output node and connect |
| 491 | NodeID detect_nid = g.add_node<DetectionPostProcessLayerNode>(detect_info); |
| 492 | g.add_connection(input_box_encoding.node_id, input_box_encoding.index, detect_nid, 0); |
| 493 | g.add_connection(input_class_prediction.node_id, input_class_prediction.index, detect_nid, 1); |
| 494 | g.add_connection(anchors_nid, 0, detect_nid, 2); |
| 495 | |
| 496 | set_node_params(g, detect_nid, params); |
| 497 | |
| 498 | return detect_nid; |
| 499 | } |
| 500 | |
| 501 | NodeID GraphBuilder::add_dummy_node(Graph &g, NodeParams params, NodeIdxPair input, TensorShape shape) |
| 502 | { |
nothing calls this directly
no test coverage detected