You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been using your SORT/yolov7 implementation, thanks for your work! There were 2 issues I ran in to with your current implementation.
The first is that it's mentioned in sort.py itself that update should be called even if there are no detections in the image. This is important for SORT to work properly if you have some frames where the detection is failing.
'dets' - a numpy array of detection in the format [[x1, y1, x2, y2, score], [x1,y1,x2,y2,score],...]
Ensure to call this method even frame has no detections. (pass np.empty((0,5)))
Returns a similar array, where the last column is object ID (replacing confidence score)
NOTE: The number of objects returned may differ from the number of objects provided.
"""
However this is not actually done in the current implementation. In crowded scenes there will rarely be any frames with no detections, so this isn't a big issue, but for my use case I had a large number of frames with no detections.
Another issue I ran in to is that the current implementation will fail if you have an input that results in more than 5005 unique tracks and you're using --colored-trk.
I fixed this by changing this from 5005 to 5003, since that is a prime number.
to rand_color_list[track.id % len(rand_color_list)], thickness=2), since after that many detections it won't really matter anyway that the same colours are picked again. Not the most elegant solution, but it works :).
The text was updated successfully, but these errors were encountered:
Thanks @C-van-der-Laan! Can you please send me a pull request, you can then become a contributor to the repository.
Otherwise, I will do changes on my own. 👍🏻
C-van-der-Laan
added a commit
to C-van-der-Laan/yolov7-object-tracking
that referenced
this issue
May 27, 2023
Hi,
I've been using your SORT/yolov7 implementation, thanks for your work! There were 2 issues I ran in to with your current implementation.
The first is that it's mentioned in sort.py itself that update should be called even if there are no detections in the image. This is important for SORT to work properly if you have some frames where the detection is failing.
yolov7-object-tracking/sort.py
Lines 222 to 232 in 936097e
However this is not actually done in the current implementation. In crowded scenes there will rarely be any frames with no detections, so this isn't a big issue, but for my use case I had a large number of frames with no detections.
This can easily be corrected by inserting a
here
yolov7-object-tracking/detect_and_track.py
Line 238 in 936097e
Another issue I ran in to is that the current implementation will fail if you have an input that results in more than 5005 unique tracks and you're using --colored-trk.
I fixed this by changing this from 5005 to 5003, since that is a prime number.
yolov7-object-tracking/detect_and_track.py
Line 78 in 936097e
then just changing this
yolov7-object-tracking/detect_and_track.py
Line 207 in 936097e
to
rand_color_list[track.id % len(rand_color_list)], thickness=2)
, since after that many detections it won't really matter anyway that the same colours are picked again. Not the most elegant solution, but it works :).The text was updated successfully, but these errors were encountered: