Replies: 2 comments 8 replies
-
Hello again, I have been trying to do almost the same steps previous to reading this post, so this might be a good sign to be going into the right solution. I will keep trying to solve it, just let me know if you have any idea to try, or much more better, if you have solution that you have already tested. Thank you for your help, I will also let you know if I have any progress. |
Beta Was this translation helpful? Give feedback.
-
Hi guys, How are you doing? Has anyone managed to parse the Yolo output? I think I can extract the results, but I still haven't been able to manage the detection and apply the bounding boxes. Does anyone have a tip to do it. hahaha Thanks guys! |
Beta Was this translation helpful? Give feedback.
-
This is an informal guide to help users understand how to handle the output of a quantized yolov5 that can be obtained by following the guide of this repository.
It is not polished and might contain errors
You might be used to a different output format, because the scripts in the yolov5 repository usually post-process the output for you.
Once you have your model, you can create an ACAP that runs it on the device.
There are currently no examples of an ACAP running specifically Yolov5, but there are many examples showing how to run other models, that can be adapted, see minimal ml inference, object detection python, pose estimator with flask and the native object detector.
One tricky part of integrating Yolo in your ACAP could be about understanding the output format.
as output, you will get an array of
Nx(5+C)
Where
C
is the number of classes specified in your training andN
is a fixed number of detections you get (typically 25200).So for each detection, you will get an array of
(5+C)
elements, that will look like this:[x, y, w, h, object_likelihood, class1_likelihood, class2_likelihood, class3_likelihood, ... ]
x
andy
are the coordinates of the center of your detection box,w
andh
are the width and height of your detection box,object_likelihood
can be interpreted as the likelihood that box is "something"class1_likelihood
is the likelihood that the object is of class 1 and so on.Another thing to keep in mind is that the output is quantized.
To obtain meaningful values, (especially for the box locations), you need to apply a shift and scale to the output values.
The quantization parameters can be found before developing the ACAP with this code snippet:
The quantization parameters will not change, unless the model changes, so they could be hardcoded as part of your ACAP.
Here is another pseudo-code snippet to give an idea of how to process your output:
Keep in mind that these snippets are made to offer high level guidance. They are "pseudo code"
Feedback is always appreciated!
Beta Was this translation helpful? Give feedback.
All reactions