Hi I'm trying to perform object detection using MobilenetSSD caffe model with SNPE APIs.(I have already tested the SNPE setup with Alexnet and Inception models, and i'm getting the results without any issue). I'm have converted the caffemodel to .DLC file. I have tested with using snpe-net-run tool, I am getting output for that also, output is some .raw files. How can i get the detection coordinates of objects for drawing the bounding boxes ?
Please Help on this.
Kindly read the date from the raw file generated with the following python code and find the explanation below on how to parse the output.
Explanation:
res[0, 1] will be ID for the label, as it was trained on VOC Label 6 which belongs to the bus.
res[0, 2] represent the probability of the predicted object, it is 0.9992 here
res[0, 3:7] are the scaled X1, Y1 & X2, Y2 Values respectively.
For re-scaling it Multiply X1 & X2 with Width of image & Y1 & Y2 with the Height of the image, and cast it to the Integer.
This gives the bounding box for the object predicted.
Command to convert the caffe model to dlc:
$ snpe-caffe-to-dlc --input_network MobileNetSSD_deploy.prototxt --caffe_bin MobileNetSSD_deploy.caffemodel --output_path caffe_mobilenet_ssd.dlc