classy-sort-yolov5 icon indicating copy to clipboard operation
classy-sort-yolov5 copied to clipboard

To get confidence score parameter in the sort output

Open hlmhlr opened this issue 3 years ago • 3 comments

Hi, Thanks for your repo with multi-class sort. Currently, sort outputs the following parameters: "frame_num, bbox_x1, bbox_y1, bbox_x2, bbox_y2, category, u_overdot, v_overdot, s_overdot, and identity".

How can I add confidence score value for the tracked objects? The output required is: "frame_num, bbox_x1, bbox_y1, bbox_x2, bbox_y2, category, u_overdot, v_overdot, s_overdot, identity, and confidence_score".

Your help would be highly appreciated. Thanks,

hlmhlr avatar Dec 23 '21 08:12 hlmhlr

Hi, do you still need assistance with this issue?

tensorturtle avatar Jan 29 '22 05:01 tensorturtle

I have the same needs

RUIXUEZHAOFENGNIAN avatar May 20 '22 10:05 RUIXUEZHAOFENGNIAN

Hi @RUIXUEZHAOFENGNIAN , I won't be making that modification because it is a breaking change, but I can tell you how to do it yourself:

  1. In sort.py's KalmanBoxTracker class, find __init__() and update(). Put self.conf = bbox[4] in each.
  2. In the same class, under get_state(), add the confidence to the returned tensor with: arr_conf = np.expand_dims(np.array([self.conf]), 0). Put arr_conf in the final np.concatenate function, wherever you'd like.
  3. Make corresponding changes the code that follows.

tensorturtle avatar May 23 '22 08:05 tensorturtle