classy-sort-yolov5
classy-sort-yolov5 copied to clipboard
To get confidence score parameter in the sort output
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,
Hi, do you still need assistance with this issue?
I have the same needs
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:
-
In sort.py's KalmanBoxTracker class, find
__init__()
andupdate()
. Putself.conf = bbox[4]
in each. - 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)
. Putarr_conf
in the finalnp.concatenate
function, wherever you'd like. - Make corresponding changes the code that follows.