[Python] Select box with highest Confidence YOLO

Discussão em 'Python' iniciado por Stack, Maio 27, 2025.

  1. Stack

    Stack Membro Participativo

    I have a YOLO model that is predicting a single class from images. In some cases it is misinterpreting the image and predicting multiple of the class in one image while there is only one. I have noticed that the correct one has the highest confidence value. Here is my code for predicting:

    [​IMG]

    Here is the relevant output:

    [​IMG]

    The box with 0.8853 confidence shows up as the first entry in the conf tensor but shows up last at the data tensor. How do I choose the box with the highest confidence and find its data?

    Continue reading...

Compartilhe esta Página