yolov4-deepsort icon indicating copy to clipboard operation
yolov4-deepsort copied to clipboard

How to save the detection and tracking result in a file?

Open pordeli opened this issue 3 years ago • 3 comments

Hi.

I can see the tracking results on screen by using the --info argument. How can I save them in a text file (the IDs and coordinates of detected boxes)?

pordeli avatar May 11 '21 01:05 pordeli

hey did u know how to solve above? struggling for this?

PraveenGit3 avatar Jul 06 '21 20:07 PraveenGit3

I do in that way 1º - I create a variable to get the output of that command image 2º - export that in a txt file using the function image

denmarquess avatar Jul 27 '21 13:07 denmarquess

Go to inside object_tracker.py and try to get values from that part ->

# draw bbox on screen
    color = colors[int(track.track_id) % len(colors)]
    color = [i * 255 for i in color]
    cv2.rectangle(frame, (int(bbox[0]), int(bbox[1])), (int(bbox[2]), int(bbox[3])), color, 2)
    cv2.rectangle(frame, (int(bbox[0]), int(bbox[1]-30)), (int(bbox[0])+(len(class_name)+len(str(track.track_id)))*17, int(bbox[1])), color, -1)
    cv2.putText(frame, class_name + "-" + str(track.track_id),(int(bbox[0]), int(bbox[1]-10)),0, 0.75, (255,255,255),2)

You could store these values as well. See below please. print("frame_num:",frame_num, "person id:" + str(track.track_id), "bbox:" ,bbox )

Output: frame_num: 48 person id:1 bbox: [433.99727797 243.87391317 993.38272104 629.23692898] frame_num: 48 person id:2 bbox: [190.61178465 202.11683543 513.15014026 626.55630477] ......

senemaktas avatar Aug 12 '21 13:08 senemaktas