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: Here is the relevant output: 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...