Good day,
I have use YOLOv3 model to detect only human objects appear in the scene. Basically, YOLO model tries to detect human objects in each frame, although it seems like tracking since the bounding box is constantly moves.
I am looking for a feasible method to track each detected human objects by assigning an identifier to each of them. (Please see provided image)
Following codes are used to draw a bounding box based on left, top, right, bottom, which imply x, width, y, height. Is that possible for me to assign an identifier to each detected human objects?
E.g. Assign ID_1 to detected "person:0.73", while assign ID_2 to "person:1.00"
Much appreciate your help and time, thank you.
Trying to assign an identifier to each detected person
def drawPred(classId, conf, left, top, right, bottom):
# Draw a bounding box.
cv2.rectangle(resized_frame, (left, top), (right, bottom), (255,0,255), 5)
label = '%.2f' % conf
# Get the label for the class name and its confidence
if classes:
assert(classId < len(classes))
label = '%s:%s' % (classes[classId], label)
#Display the label at the top of the bounding box
labelSize, baseLine = cv2.getTextSize(label, cv2.FONT_HERSHEY_SIMPLEX, 0.5, 1)
top = max(top, labelSize[1]) - 5
cv2.putText(resized_frame, label, (left, top), cv2.FONT_HERSHEY_SIMPLEX, 1, (0,255,255), 2)