RizwanMunawar / yolov7-object-tracking

YOLOv7 Object Tracking Using PyTorch, OpenCV and Sort Tracking
GNU General Public License v3.0
551 stars 166 forks source link

Detect & Tracking Does not Save Tracked Trajectories or Detections #10

Closed AdrielAmoguis closed 1 year ago

AdrielAmoguis commented 1 year ago

Hello!

With default yolo7.pt weights, I am using this codebase to perform simultaneous detect and track predictions on a dataset of highway videos. I want to save the tracked trajectories either in a serialized form or a human-readable form. However, the --save-txt and --save-conf arguments do not work. It creates a labels directory but does not write any files. The expected output video file does exist and contains the trajectories as expected.

The command I use for detect_and_track.py is as follows:

python detect_and_track.py --weights ./weights/yolov7.pt --conf 0.25 --img-size 640 --source "video.mp4" --save-txt --view-img --iou-thres 0.35 --classes 1 2 3 5 6 7

Replacing detect_and_track.py with the default detect.py using just object detection for YOLOv7 does work, but no trajectories are tracked.

System Information

macOS Ventura 13.0 MacBook Pro 2020, M1 with 16GB RAM, running CPU for inference

Am I using this incorrectly, or is there a bug that needs investigation? Or is this not implemented yet?

Thank you, Adi

RizwanMunawar commented 1 year ago

@AdrielAmoguis! The trajectory points saving feature is not added yet! Thanks for providing your valuable and useful thoughts. Soon, I will add this feature.

AdrielAmoguis commented 1 year ago

Alright, thanks for the prompt response! For now, I'll try to append the code to implement this. I'll open a pull request in case I come up with reasonably presentable code for it.

RizwanMunawar commented 1 year ago

@AdrielAmoguis! I am closing this issue, because you have solved this issue, and developed the code for that which I already merged in master branch with your pull request. Thanks for your valuable contribution.