Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexError for HybridSort tracker #1423

Closed
1 task done
RenzoMinelli opened this issue May 10, 2024 · 6 comments
Closed
1 task done

IndexError for HybridSort tracker #1423

RenzoMinelli opened this issue May 10, 2024 · 6 comments
Labels
bug Something isn't working Stale

Comments

@RenzoMinelli
Copy link

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
@RenzoMinelli RenzoMinelli added the bug Something isn't working label May 10, 2024
@AloysiusChua0822
Copy link

I am having the same issue here

@mikel-brostrom
Copy link
Owner

What is you max_age?

@mikel-brostrom
Copy link
Owner

Is this value greater than 50? This is, the deque length

@RenzoMinelli
Copy link
Author

I'm using the default, 130.

@mikel-brostrom
Copy link
Owner

mikel-brostrom commented May 15, 2024

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.

Copy link

👋 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale
Projects
None yet
Development

No branches or pull requests

3 participants