TexasInstruments / jacinto-ai-devkit

This repository has been moved. The new location is in https://github.com/TexasInstruments/edgeai-tensorlab
https://github.com/TexasInstruments/edgeai
Other
86 stars 19 forks source link

Bounding box information in output tensor of onnx model #8

Open PrithviKambhampati opened 3 years ago

PrithviKambhampati commented 3 years ago

Hi, I trained a model with Regnet backbone with regnetx_800mf arch and RetinanetLite head and converted it to an onnx model. There are 10 output tensors in the onnx model as in the prototxt file. In which of these output tensors is the labels, scores and, bounding box information saved? retinanet-lite.zip

I have attached the architecture and prototxt files in the zipped folder. Contents of model.prototxt: name: "retinanet" tidl_retinanet { box_input: "retina_reg_0" box_input: "retina_reg_1" box_input: "retina_reg_2" box_input: "retina_reg_3" box_input: "retina_reg_4" class_input: "retina_cls_0" class_input: "retina_cls_1" class_input: "retina_cls_2" class_input: "retina_cls_3" class_input: "retina_cls_4" output: "output" in_width: 512 in_height: 512 x_scale: 1.0 y_scale: 1.0 width_scale: 1.0 height_scale: 1.0 score_converter: SIGMOID anchor_param { aspect_ratio: 0.5 aspect_ratio: 1.0 aspect_ratio: 2.0 octave_base_scale: 4.0 scales_per_octave: 3 } detection_output_param { num_classes: 17 share_location: true background_label_id: -1 nms_param { nms_threshold: 0.45 top_k: 100 } code_type: CENTER_SIZE keep_top_k: 100 confidence_threshold: 0.5 } }

-Prithvi

mathmanu commented 3 years ago

If you export the onnx graph using original https://github.com/open-mmlab/mmdetection it results in a complicated graph for the final detection portion after the convolution layers. However, we have represented all the information required for the detection in this prototxt. The inference engine can then take this onnx and prototxt and produce the detections. The final detection layer will be created by the inference engine based on the information provided in the prototxt file.