0

Is there documentation for what yolo-v5's output is?

We (or I) are trying to use YOLOv5 (for now) to detect faces in real time from an HDMI input. Cartoon faces, video game faces, natural faces - all are welcome for our application. I've followed the instructions to retrain it, but, the results seem nonsensical.

enter image description here

I've red the embedding/export instructions - but - don't understand the details of how to interpret the output tensor.

TLDR; I'm trying to interpret the yolo-v5 output but the examples don't seem to illustrate what's going on to me.

1
  • Do you have the code you tried so you can post it to the question? As you probably know, links to external code aren't exactly the same thing. Commented Aug 6 at 16:05

1 Answer 1

0

So ... the Unity3D BarraCUDA thing seems to emit YOLOv5 results in column major order. The C++ and Python examples show the results in row-major order.

My transpose function looks something like this ... and it works now


        /// <summary>
        /// 
        /// </summary>
        /// <param name="width">5 + number of classes</param>
        /// <param name="floats">outputTensor.ToReadOnlyArray()</param>
        /// <returns></returns>
        private static IEnumerable<(Rect, float, float)> Transpose(int width, float[] floats)
        {
            Debug.Assert(6 == width); // i only have one class (you'll need to change the return value if you use more)
            int l = floats.Length;
            int count = l / width;


            // pre-compute these
            var heads = Enumerable.Range(0, width).ToArray();


            // process each "row" - you (i) can run this in parallel just fine
            return Enumerable.Range(0, count).Select(i =>
            {
                // compute the entry
                var entry = heads.Select(h => floats[i + (h * count)]).ToArray();


                var rect = new Rect();

                rect.x = entry[0];
                rect.y = entry[1];
                rect.width = entry[2];
                rect.height = entry[3];

                return (rect, entry[4], entry[5]);
            });
        }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.