IndexError for HybridSort tracker
Closed this issue · 6 comments
Search before asking
- I have searched the Yolo Tracking issues and discussions and found no similar questions.
Yolo Tracking Component
Tracking
Bug
I'm running HybridSort with Yolov8 L, when processing image 100 it raises an IndexError exception in the file boxmot/motion/kalman_filters/hybridsort_kf.py
in line 399.
Traceback
image 100/147 /home/renzo/catkin_ws/left_rgb_images/484573000000.png: 640x640 92 apples, 981.2ms
Traceback (most recent call last):
File "yolo_tracking/tracking/track.py", line 172, in <module>
run(opt)
File "/home/renzo/.cache/pypoetry/virtualenvs/boxmot-kj4Ofkam-py3.8/lib/python3.8/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "yolo_tracking/tracking/track.py", line 101, in run
for r in results:
File "/home/renzo/.cache/pypoetry/virtualenvs/boxmot-kj4Ofkam-py3.8/lib/python3.8/site-packages/torch/utils/_contextlib.py", line 56, in generator_context
response = gen.send(request)
File "/home/renzo/.cache/pypoetry/virtualenvs/boxmot-kj4Ofkam-py3.8/lib/python3.8/site-packages/ultralytics/engine/predictor.py", line 274, in stream_inference
self.run_callbacks('on_predict_postprocess_end')
File "/home/renzo/.cache/pypoetry/virtualenvs/boxmot-kj4Ofkam-py3.8/lib/python3.8/site-packages/ultralytics/engine/predictor.py", line 377, in run_callbacks
callback(self)
File "/home/renzo/.cache/pypoetry/virtualenvs/boxmot-kj4Ofkam-py3.8/lib/python3.8/site-packages/ultralytics/trackers/track.py", line 60, in on_predict_postprocess_end
tracks = predictor.trackers[i].update(det, im0s[i])
File "/home/renzo/catkin_ws/yolo_tracking/boxmot/utils/__init__.py", line 79, in wrapper
tracks = self.update(instance, dets, im)
File "/home/renzo/catkin_ws/yolo_tracking/boxmot/trackers/hybridsort/hybridsort.py", line 469, in update
self.active_tracks[m[1]].update(dets[m[0], :], dets0[m[0], 5], dets0[m[0], 6], id_feature_keep[m[0], :])
File "/home/renzo/catkin_ws/yolo_tracking/boxmot/trackers/hybridsort/hybridsort.py", line 286, in update
self.kf.update(convert_bbox_to_z(bbox))
File "/home/renzo/catkin_ws/yolo_tracking/boxmot/motion/kalman_filters/hybridsort_kf.py", line 489, in update
self.unfreeze()
File "/home/renzo/catkin_ws/yolo_tracking/boxmot/motion/kalman_filters/hybridsort_kf.py", line 401, in unfreeze
index1 = indices[-2]
IndexError: index -2 is out of bounds for axis 0 with size 1
Environment
Python 3.8.10
ultralytics 8.0.228
Yolo v8 Large
ROS noetic
Minimal Reproducible Example
python3 yolo_tracking/tracking/track.py --yolo-model weights/yolov8l_150.pt --tracking-method hybridsort --source left_rgb_images --save --save-txt
I am having the same issue here
What is you max_age
?
Is this value greater than 50? This is, the deque length
I'm using the default, 130.
I see. Just set this value less than 50. The crash happens due to the deque size storing the observations being smaller than the max age. Alternatively you can set the observation deque to be larger than 130.
👋 Hello, this issue has been automatically marked as stale because it has not had recent activity. Please note it will be closed if no further activity occurs.
Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!