experiencor / keras-yolo3

Training and Detecting Objects with YOLO3
MIT License
1.61k stars 861 forks source link

draw boxes can't give more then one class #300

Open hxfdanger opened 3 years ago

hxfdanger commented 3 years ago

trying to understand YOLOV3, I noticed that in function draw_boxes() in utils.py, there are a loop that is not really useful and I would like to understand why you have chosen this way ?

for i in range(len(labels)):
    if box.classes[i] > obj_thresh:
          if label_str != '': label_str += ', '
          label_str += (labels[i] + ' ' + str(round(box.get_score()*100, 2)) + '%')
          label = i
    if not quiet: print(label_str)

my question: Why you browse all labels when you could get the best predicted class from the box.get_score() function knowing that in the end we will have only one predicted class ??