36 class GraphSSDMobilenetExample :
public Example 39 GraphSSDMobilenetExample()
40 : cmd_parser(), common_opts(cmd_parser), common_params(), graph(0,
"MobileNetSSD")
44 keep_topk_opt->
set_help(
"Top k detections results per image. Used for data type F32.");
47 detection_boxes_opt->
set_help(
"Filename containing the reference values for the graph output detection_boxes. Used for data type QASYMM8.");
49 detection_classes_opt->
set_help(
"Filename containing the reference values for the output detection_classes. Used for data type QASYMM8.");
51 detection_scores_opt->
set_help(
"Filename containing the reference values for the output detection_scores. Used for data type QASYMM8.");
53 num_detections_opt->
set_help(
"Filename containing the reference values for the output num_detections. Used with datatype QASYMM8.");
55 GraphSSDMobilenetExample(
const GraphSSDMobilenetExample &) =
delete;
56 GraphSSDMobilenetExample &operator=(
const GraphSSDMobilenetExample &) =
delete;
57 ~GraphSSDMobilenetExample()
override =
default;
58 bool do_setup(
int argc,
char **argv)
override 61 cmd_parser.parse(argc, argv);
62 cmd_parser.validate();
68 if(common_params.help)
70 cmd_parser.print_help(argv[0]);
75 std::cout << common_params << std::endl;
82 graph << common_params.
target 83 << common_params.fast_math_hint;
88 create_graph_float(input_descriptor);
92 create_graph_qasymm(input_descriptor);
98 config.
use_tuner = common_params.enable_tuner;
100 config.
mlgo_file = common_params.mlgo_file;
102 graph.finalize(common_params.target, config);
106 void do_run()
override 124 ConcatLayer get_node_A_float(
IStream &master_graph,
const std::string &data_path, std::string &¶m_path,
125 unsigned int conv_filt,
128 const std::string total_path = param_path +
"_";
134 std::unique_ptr<arm_compute::graph::ITensorAccessor>(
nullptr),
147 std::unique_ptr<arm_compute::graph::ITensorAccessor>(
nullptr),
148 conv_pad_stride_info)
160 ConcatLayer get_node_B_float(
IStream &master_graph,
const std::string &data_path, std::string &¶m_path,
161 unsigned int conv_filt,
164 const std::string total_path = param_path +
"_";
170 std::unique_ptr<arm_compute::graph::ITensorAccessor>(
nullptr),
171 conv_pad_stride_info_1)
183 std::unique_ptr<arm_compute::graph::ITensorAccessor>(
nullptr),
184 conv_pad_stride_info_2)
196 ConcatLayer get_node_C_float(
IStream &master_graph,
const std::string &data_path, std::string &¶m_path,
199 const std::string total_path = param_path +
"_";
205 conv_pad_stride_info)
219 const std::array<float, 3> mean_rgb{ { 127.5f, 127.5f, 127.5f } };
220 std::unique_ptr<IPreprocessor> preprocessor = std::make_unique<CaffePreproccessor>(mean_rgb,
true, 0.007843f);
223 std::string data_path = common_params.
data_path;
226 if(!data_path.empty())
228 data_path +=
"/cnn_data/ssd_mobilenet_model/";
238 std::unique_ptr<arm_compute::graph::ITensorAccessor>(
nullptr),
248 conv_11 << get_node_A_float(conv_11, data_path,
"conv1", 64,
PadStrideInfo(1, 1, 1, 1),
PadStrideInfo(1, 1, 0, 0));
249 conv_11 << get_node_A_float(conv_11, data_path,
"conv2", 128,
PadStrideInfo(2, 2, 1, 1),
PadStrideInfo(1, 1, 0, 0));
250 conv_11 << get_node_A_float(conv_11, data_path,
"conv3", 128,
PadStrideInfo(1, 1, 1, 1),
PadStrideInfo(1, 1, 0, 0));
251 conv_11 << get_node_A_float(conv_11, data_path,
"conv4", 256,
PadStrideInfo(2, 2, 1, 1),
PadStrideInfo(1, 1, 0, 0));
252 conv_11 << get_node_A_float(conv_11, data_path,
"conv5", 256,
PadStrideInfo(1, 1, 1, 1),
PadStrideInfo(1, 1, 0, 0));
253 conv_11 << get_node_A_float(conv_11, data_path,
"conv6", 512,
PadStrideInfo(2, 2, 1, 1),
PadStrideInfo(1, 1, 0, 0));
254 conv_11 << get_node_A_float(conv_11, data_path,
"conv7", 512,
PadStrideInfo(1, 1, 1, 1),
PadStrideInfo(1, 1, 0, 0));
255 conv_11 << get_node_A_float(conv_11, data_path,
"conv8", 512,
PadStrideInfo(1, 1, 1, 1),
PadStrideInfo(1, 1, 0, 0));
256 conv_11 << get_node_A_float(conv_11, data_path,
"conv9", 512,
PadStrideInfo(1, 1, 1, 1),
PadStrideInfo(1, 1, 0, 0));
257 conv_11 << get_node_A_float(conv_11, data_path,
"conv10", 512,
PadStrideInfo(1, 1, 1, 1),
PadStrideInfo(1, 1, 0, 0));
258 conv_11 << get_node_A_float(conv_11, data_path,
"conv11", 512,
PadStrideInfo(1, 1, 1, 1),
PadStrideInfo(1, 1, 0, 0));
261 conv_13 << get_node_A_float(conv_11, data_path,
"conv12", 1024,
PadStrideInfo(2, 2, 1, 1),
PadStrideInfo(1, 1, 0, 0));
262 conv_13 << get_node_A_float(conv_13, data_path,
"conv13", 1024,
PadStrideInfo(1, 1, 1, 1),
PadStrideInfo(1, 1, 0, 0));
265 conv_14 << get_node_B_float(conv_13, data_path,
"conv14", 512,
PadStrideInfo(1, 1, 0, 0),
PadStrideInfo(2, 2, 1, 1));
268 conv_15 << get_node_B_float(conv_14, data_path,
"conv15", 256,
PadStrideInfo(1, 1, 0, 0),
PadStrideInfo(2, 2, 1, 1));
271 conv_16 << get_node_B_float(conv_15, data_path,
"conv16", 256,
PadStrideInfo(1, 1, 0, 0),
PadStrideInfo(2, 2, 1, 1));
274 conv_17 << get_node_B_float(conv_16, data_path,
"conv17", 128,
PadStrideInfo(1, 1, 0, 0),
PadStrideInfo(2, 2, 1, 1));
278 conv_11_mbox_loc << get_node_C_float(conv_11, data_path,
"conv11_mbox_loc", 12,
PadStrideInfo(1, 1, 0, 0));
281 conv_13_mbox_loc << get_node_C_float(conv_13, data_path,
"conv13_mbox_loc", 24,
PadStrideInfo(1, 1, 0, 0));
284 conv_14_2_mbox_loc << get_node_C_float(conv_14, data_path,
"conv14_2_mbox_loc", 24,
PadStrideInfo(1, 1, 0, 0));
287 conv_15_2_mbox_loc << get_node_C_float(conv_15, data_path,
"conv15_2_mbox_loc", 24,
PadStrideInfo(1, 1, 0, 0));
290 conv_16_2_mbox_loc << get_node_C_float(conv_16, data_path,
"conv16_2_mbox_loc", 24,
PadStrideInfo(1, 1, 0, 0));
293 conv_17_2_mbox_loc << get_node_C_float(conv_17, data_path,
"conv17_2_mbox_loc", 24,
PadStrideInfo(1, 1, 0, 0));
296 mbox_loc <<
ConcatLayer(std::move(conv_11_mbox_loc), std::move(conv_13_mbox_loc), conv_14_2_mbox_loc, std::move(conv_15_2_mbox_loc),
297 std::move(conv_16_2_mbox_loc), std::move(conv_17_2_mbox_loc));
301 conv_11_mbox_conf << get_node_C_float(conv_11, data_path,
"conv11_mbox_conf", 63,
PadStrideInfo(1, 1, 0, 0));
304 conv_13_mbox_conf << get_node_C_float(conv_13, data_path,
"conv13_mbox_conf", 126,
PadStrideInfo(1, 1, 0, 0));
307 conv_14_2_mbox_conf << get_node_C_float(conv_14, data_path,
"conv14_2_mbox_conf", 126,
PadStrideInfo(1, 1, 0, 0));
310 conv_15_2_mbox_conf << get_node_C_float(conv_15, data_path,
"conv15_2_mbox_conf", 126,
PadStrideInfo(1, 1, 0, 0));
313 conv_16_2_mbox_conf << get_node_C_float(conv_16, data_path,
"conv16_2_mbox_conf", 126,
PadStrideInfo(1, 1, 0, 0));
316 conv_17_2_mbox_conf << get_node_C_float(conv_17, data_path,
"conv17_2_mbox_conf", 126,
PadStrideInfo(1, 1, 0, 0));
319 mbox_conf <<
ConcatLayer(std::move(conv_11_mbox_conf), std::move(conv_13_mbox_conf), std::move(conv_14_2_mbox_conf),
320 std::move(conv_15_2_mbox_conf), std::move(conv_16_2_mbox_conf), std::move(conv_17_2_mbox_conf));
325 const std::vector<float> priorbox_variances = { 0.1f, 0.1f, 0.2f, 0.2f };
326 const float priorbox_offset = 0.5f;
327 const std::vector<float> priorbox_aspect_ratios = { 2.f, 3.f };
330 SubStream conv_11_mbox_priorbox(conv_11);
333 PriorBoxLayerInfo({ 60.f }, priorbox_variances, priorbox_offset,
true,
false, {}, { 2.f }))
336 SubStream conv_13_mbox_priorbox(conv_13);
338 PriorBoxLayerInfo({ 105.f }, priorbox_variances, priorbox_offset,
true,
false, { 150.f }, priorbox_aspect_ratios))
341 SubStream conv_14_2_mbox_priorbox(conv_14);
343 PriorBoxLayerInfo({ 150.f }, priorbox_variances, priorbox_offset,
true,
false, { 195.f }, priorbox_aspect_ratios))
346 SubStream conv_15_2_mbox_priorbox(conv_15);
348 PriorBoxLayerInfo({ 195.f }, priorbox_variances, priorbox_offset,
true,
false, { 240.f }, priorbox_aspect_ratios))
351 SubStream conv_16_2_mbox_priorbox(conv_16);
353 PriorBoxLayerInfo({ 240.f }, priorbox_variances, priorbox_offset,
true,
false, { 285.f }, priorbox_aspect_ratios))
356 SubStream conv_17_2_mbox_priorbox(conv_17);
358 PriorBoxLayerInfo({ 285.f }, priorbox_variances, priorbox_offset,
true,
false, { 300.f }, priorbox_aspect_ratios))
366 std::move(conv_11_mbox_priorbox), std::move(conv_13_mbox_priorbox), std::move(conv_14_2_mbox_priorbox),
367 std::move(conv_15_2_mbox_priorbox), std::move(conv_16_2_mbox_priorbox), std::move(conv_17_2_mbox_priorbox));
369 const int num_classes = 21;
370 const bool share_location =
true;
372 const int keep_top_k = keep_topk_opt->value();
373 const float nms_threshold = 0.45f;
374 const int label_id_background = 0;
375 const float conf_thrs = 0.25f;
376 const int top_k = 100;
380 DetectionOutputLayerInfo(num_classes, share_location, detection_type, keep_top_k, nms_threshold, top_k, label_id_background, conf_thrs));
384 ConcatLayer get_node_A_qasymm(
IStream &master_graph,
const std::string &data_path, std::string &¶m_path,
385 unsigned int conv_filt,
387 std::pair<QuantizationInfo, QuantizationInfo> depth_quant_info, std::pair<QuantizationInfo, QuantizationInfo> point_quant_info)
389 const std::string total_path = param_path +
"_";
396 dwc_pad_stride_info, 1, depth_quant_info.first, depth_quant_info.second)
404 conv_pad_stride_info, 1, point_quant_info.first, point_quant_info.second)
411 ConcatLayer get_node_B_qasymm(
IStream &master_graph,
const std::string &data_path, std::string &¶m_path,
412 unsigned int conv_filt,
414 const std::pair<QuantizationInfo, QuantizationInfo> quant_info_1x1,
const std::pair<QuantizationInfo, QuantizationInfo> quant_info_3x3)
416 const std::string total_path = param_path +
"_";
423 conv_pad_stride_info_1x1, 1, quant_info_1x1.first, quant_info_1x1.second)
431 conv_pad_stride_info_3x3, 1, quant_info_3x3.first, quant_info_3x3.second)
438 ConcatLayer get_node_C_qasymm(
IStream &master_graph,
const std::string &data_path, std::string &¶m_path,
440 const std::pair<QuantizationInfo, QuantizationInfo> quant_info,
TensorShape reshape_shape)
442 const std::string total_path = param_path +
"_";
448 conv_pad_stride_info, 1, quant_info.first, quant_info.second)
462 std::string data_path = common_params.
data_path;
465 if(!data_path.empty())
467 data_path +=
"/cnn_data/ssd_mobilenet_qasymm8_model/";
471 const std::vector<std::pair<QuantizationInfo, QuantizationInfo>> conv_quant_info =
484 const std::vector<std::pair<QuantizationInfo, QuantizationInfo>> depth_quant_info =
501 const std::vector<std::pair<QuantizationInfo, QuantizationInfo>> point_quant_info =
530 graph << get_node_A_qasymm(graph, data_path,
"conv1", 64U,
PadStrideInfo(1U, 1U, 1U, 1U, 1U, 1U,
DimensionRoundingType::CEIL),
PadStrideInfo(1U, 1U, 0U, 0U), depth_quant_info.at(0),
531 point_quant_info.at(0));
532 graph << get_node_A_qasymm(graph, data_path,
"conv2", 128U,
PadStrideInfo(2U, 2U, 0U, 1U, 0U, 1U,
DimensionRoundingType::CEIL),
PadStrideInfo(1U, 1U, 0U, 0U), depth_quant_info.at(1),
533 point_quant_info.at(1));
534 graph << get_node_A_qasymm(graph, data_path,
"conv3", 128U,
PadStrideInfo(1U, 1U, 1U, 1U, 1U, 1U,
DimensionRoundingType::CEIL),
PadStrideInfo(1U, 1U, 0U, 0U), depth_quant_info.at(2),
535 point_quant_info.at(2));
536 graph << get_node_A_qasymm(graph, data_path,
"conv4", 256U,
PadStrideInfo(2U, 2U, 1U, 1U, 1U, 1U,
DimensionRoundingType::CEIL),
PadStrideInfo(1U, 1U, 0U, 0U), depth_quant_info.at(3),
537 point_quant_info.at(3));
538 graph << get_node_A_qasymm(graph, data_path,
"conv5", 256U,
PadStrideInfo(1U, 1U, 1U, 1U, 1U, 1U,
DimensionRoundingType::CEIL),
PadStrideInfo(1U, 1U, 0U, 0U), depth_quant_info.at(4),
539 point_quant_info.at(4));
540 graph << get_node_A_qasymm(graph, data_path,
"conv6", 512U,
PadStrideInfo(2U, 2U, 0U, 1U, 0U, 1U,
DimensionRoundingType::CEIL),
PadStrideInfo(1U, 1U, 0U, 0U), depth_quant_info.at(5),
541 point_quant_info.at(5));
542 graph << get_node_A_qasymm(graph, data_path,
"conv7", 512U,
PadStrideInfo(1U, 1U, 1U, 1U, 1U, 1U,
DimensionRoundingType::CEIL),
PadStrideInfo(1U, 1U, 0U, 0U), depth_quant_info.at(6),
543 point_quant_info.at(6));
544 graph << get_node_A_qasymm(graph, data_path,
"conv8", 512U,
PadStrideInfo(1U, 1U, 1U, 1U, 1U, 1U,
DimensionRoundingType::CEIL),
PadStrideInfo(1U, 1U, 0U, 0U), depth_quant_info.at(7),
545 point_quant_info.at(7));
546 graph << get_node_A_qasymm(graph, data_path,
"conv9", 512U,
PadStrideInfo(1U, 1U, 1U, 1U, 1U, 1U,
DimensionRoundingType::CEIL),
PadStrideInfo(1U, 1U, 0U, 0U), depth_quant_info.at(8),
547 point_quant_info.at(8));
548 graph << get_node_A_qasymm(graph, data_path,
"conv10", 512U,
PadStrideInfo(1U, 1U, 1U, 1U, 1U, 1U,
DimensionRoundingType::CEIL),
PadStrideInfo(1U, 1U, 0U, 0U), depth_quant_info.at(9),
549 point_quant_info.at(9));
550 graph << get_node_A_qasymm(graph, data_path,
"conv11", 512U,
PadStrideInfo(1U, 1U, 1U, 1U, 1U, 1U,
DimensionRoundingType::CEIL),
PadStrideInfo(1U, 1U, 0U, 0U), depth_quant_info.at(10),
551 point_quant_info.at(10));
554 conv_13 << get_node_A_qasymm(graph, data_path,
"conv12", 1024U,
PadStrideInfo(2U, 2U, 1U, 1U, 1U, 1U,
DimensionRoundingType::CEIL),
PadStrideInfo(1U, 1U, 0U, 0U), depth_quant_info.at(11),
555 point_quant_info.at(11));
556 conv_13 << get_node_A_qasymm(conv_13, data_path,
"conv13", 1024U,
PadStrideInfo(1U, 1U, 1U, 1U, 1U, 1U,
DimensionRoundingType::CEIL),
PadStrideInfo(1U, 1U, 0U, 0U), depth_quant_info.at(12),
557 point_quant_info.at(12));
559 conv_14 << get_node_B_qasymm(conv_13, data_path,
"conv13_2", 512U,
PadStrideInfo(1U, 1U, 0U, 0U),
PadStrideInfo(2U, 2U, 0U, 1U, 0U, 1U,
DimensionRoundingType::CEIL), conv_quant_info.at(1),
560 conv_quant_info.at(2));
562 conv_15 << get_node_B_qasymm(conv_14, data_path,
"conv13_3", 256U,
PadStrideInfo(1U, 1U, 0U, 0U),
PadStrideInfo(2U, 2U, 1U, 1U, 1U, 1U,
DimensionRoundingType::CEIL), conv_quant_info.at(3),
563 conv_quant_info.at(4));
565 conv_16 << get_node_B_qasymm(conv_15, data_path,
"conv13_4", 256U,
PadStrideInfo(1U, 1U, 0U, 0U),
PadStrideInfo(2U, 2U, 1U, 1U, 1U, 1U,
DimensionRoundingType::CEIL), conv_quant_info.at(5),
566 conv_quant_info.at(6));
568 conv_17 << get_node_B_qasymm(conv_16, data_path,
"conv13_5", 128U,
PadStrideInfo(1U, 1U, 0U, 0U),
PadStrideInfo(2U, 2U, 0U, 1U, 0U, 1U,
DimensionRoundingType::CEIL), conv_quant_info.at(7),
569 conv_quant_info.at(8));
572 const std::vector<std::pair<QuantizationInfo, QuantizationInfo>> box_enc_pred_quant_info =
582 const std::vector<TensorShape> box_reshape =
593 conv_11_box_enc_pre << get_node_C_qasymm(graph, data_path,
"BoxPredictor_0_BEP", 12U,
PadStrideInfo(1U, 1U, 0U, 0U), box_enc_pred_quant_info.at(0), box_reshape.at(0));
596 conv_13_box_enc_pre << get_node_C_qasymm(conv_13, data_path,
"BoxPredictor_1_BEP", 24U,
PadStrideInfo(1U, 1U, 0U, 0U), box_enc_pred_quant_info.at(1), box_reshape.at(1));
598 SubStream conv_14_2_box_enc_pre(conv_14);
599 conv_14_2_box_enc_pre << get_node_C_qasymm(conv_14, data_path,
"BoxPredictor_2_BEP", 24U,
PadStrideInfo(1U, 1U, 0U, 0U), box_enc_pred_quant_info.at(2), box_reshape.at(2));
601 SubStream conv_15_2_box_enc_pre(conv_15);
602 conv_15_2_box_enc_pre << get_node_C_qasymm(conv_15, data_path,
"BoxPredictor_3_BEP", 24U,
PadStrideInfo(1U, 1U, 0U, 0U), box_enc_pred_quant_info.at(3), box_reshape.at(3));
604 SubStream conv_16_2_box_enc_pre(conv_16);
605 conv_16_2_box_enc_pre << get_node_C_qasymm(conv_16, data_path,
"BoxPredictor_4_BEP", 24U,
PadStrideInfo(1U, 1U, 0U, 0U), box_enc_pred_quant_info.at(4), box_reshape.at(4));
607 SubStream conv_17_2_box_enc_pre(conv_17);
608 conv_17_2_box_enc_pre << get_node_C_qasymm(conv_17, data_path,
"BoxPredictor_5_BEP", 24U,
PadStrideInfo(1U, 1U, 0U, 0U), box_enc_pred_quant_info.at(5), box_reshape.at(5));
613 std::move(conv_11_box_enc_pre), std::move(conv_13_box_enc_pre), conv_14_2_box_enc_pre, std::move(conv_15_2_box_enc_pre),
614 std::move(conv_16_2_box_enc_pre), std::move(conv_17_2_box_enc_pre))
619 const std::vector<std::pair<QuantizationInfo, QuantizationInfo>> class_pred_quant_info =
629 const std::vector<TensorShape> class_reshape =
640 conv_11_class_pre << get_node_C_qasymm(graph, data_path,
"BoxPredictor_0_CP", 273U,
PadStrideInfo(1U, 1U, 0U, 0U), class_pred_quant_info.at(0), class_reshape.at(0));
643 conv_13_class_pre << get_node_C_qasymm(conv_13, data_path,
"BoxPredictor_1_CP", 546U,
PadStrideInfo(1U, 1U, 0U, 0U), class_pred_quant_info.at(1), class_reshape.at(1));
646 conv_14_2_class_pre << get_node_C_qasymm(conv_14, data_path,
"BoxPredictor_2_CP", 546U,
PadStrideInfo(1U, 1U, 0U, 0U), class_pred_quant_info.at(2), class_reshape.at(2));
649 conv_15_2_class_pre << get_node_C_qasymm(conv_15, data_path,
"BoxPredictor_3_CP", 546U,
PadStrideInfo(1U, 1U, 0U, 0U), class_pred_quant_info.at(3), class_reshape.at(3));
652 conv_16_2_class_pre << get_node_C_qasymm(conv_16, data_path,
"BoxPredictor_4_CP", 546U,
PadStrideInfo(1U, 1U, 0U, 0U), class_pred_quant_info.at(4), class_reshape.at(4));
655 conv_17_2_class_pre << get_node_C_qasymm(conv_17, data_path,
"BoxPredictor_5_CP", 546U,
PadStrideInfo(1U, 1U, 0U, 0U), class_pred_quant_info.at(5), class_reshape.at(5));
661 std::move(conv_11_class_pre), std::move(conv_13_class_pre), std::move(conv_14_2_class_pre),
662 std::move(conv_15_2_class_pre), std::move(conv_16_2_class_pre), std::move(conv_17_2_class_pre))
663 .
set_name(
"ClassPrediction/concat");
668 const int max_detections = 10;
669 const int max_classes_per_detection = 1;
670 const float nms_score_threshold = 0.30000001192092896f;
671 const float nms_iou_threshold = 0.6000000238418579f;
672 const int num_classes = 90;
673 const float x_scale = 10.f;
674 const float y_scale = 10.f;
675 const float h_scale = 5.f;
676 const float w_scale = 5.f;
677 std::array<float, 4> scales = { y_scale, x_scale, w_scale, h_scale };
714 int main(
int argc,
char **argv)
716 return arm_compute::utils::run_example<GraphSSDMobilenetExample>(argc, argv);
TensorShape shape
Tensor shape.
Graph configuration structure Device target types.
std::unique_ptr< graph::ITensorAccessor > get_input_accessor(const arm_compute::utils::CommonGraphParams &graph_parameters, std::unique_ptr< IPreprocessor > preprocessor=nullptr, bool bgr=true)
Generates appropriate input accessor according to the specified graph parameters. ...
Use box centers and size.
std::unique_ptr< graph::ITensorAccessor > get_detection_output_accessor(const arm_compute::utils::CommonGraphParams &graph_parameters, std::vector< TensorShape > tensor_shapes, bool is_validation=false, std::ostream &output_stream=std::cout)
Generates appropriate output accessor according to the specified graph parameters.
Depthwise Convolution Layer.
1 channel, 1 F32 per channel
Strides PermutationVector
Permutation vector.
void consume_common_graph_parameters(CommonGraphValidateOptions &options, CommonParams &common_params)
Consumes the consume_common_graph_parameters graph options and creates a structure containing any inf...
Includes all the Graph headers at once.
Common command line options used to configure the graph examples.
std::unique_ptr< graph::ITensorAccessor > get_npy_output_accessor(const std::string &npy_path, TensorShape shape, DataType data_type, DataLayout data_layout=DataLayout::NCHW, std::ostream &output_stream=std::cout)
Generates appropriate npy output accessor according to the specified npy_path.
Class to parse command line arguments.
arm_compute::DataLayout data_layout
DetectionOutputLayerCodeType
Available Detection Output code types.
Activation Layer Information class.
Copyright (c) 2017-2021 Arm Limited.
std::string mlgo_file
Filename to load MLGO heuristics from.
int main(int argc, char **argv)
Main program for MobileNetSSD.
std::string tuner_file
File to load/store tuning values from.
Quantization information.
DetectionOutputPostProcess Layer.
Padding and stride information class.
TensorDescriptor & set_quantization_info(QuantizationInfo tensor_quant_info)
Sets tensor descriptor quantization info.
Num samples, channels, height, width.
TensorShape permute_shape(TensorShape tensor_shape, DataLayout in_data_layout, DataLayout out_data_layout)
Permutes a given tensor shape given the input and output data layout.
TensorDescriptor & set_layout(DataLayout data_layout)
Sets tensor descriptor data layout.
Detection Output layer info.
Structure holding all the common graph parameters.
Upper Bounded Rectifier ( )
Num samples, height, width, channels.
bool use_tuner
Use a tuner in tunable backends.
std::unique_ptr< graph::ITensorAccessor > get_weights_accessor(const std::string &path, const std::string &data_file, DataLayout file_layout=DataLayout::NCHW)
Generates appropriate weights accessor according to the specified path.
Detection Output layer info.
int num_threads
Number of threads to use (thread capable backends), if 0 the backend will auto-initialize, if -1 the backend will stay as it is.
Concatenate layer descriptor.
Stream frontend class to construct simple graphs in a stream fashion.
Batchnormalization Layer.
ILayer & set_name(std::string name)
Sets the name of the layer.
void set_help(std::string help)
Set the help message for the option.
bool is_data_type_float(DataType dt)
Check if a given data type is of floating point type.