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

OCSort non-default max_age error #1414

Closed
1 task done
MABatin opened this issue May 6, 2024 · 7 comments
Closed
1 task done

OCSort non-default max_age error #1414

MABatin opened this issue May 6, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@MABatin
Copy link

MABatin commented May 6, 2024

Search before asking

  • I have searched the Yolo Tracking issues and discussions and found no similar questions.

Yolo Tracking Component

Tracking

Bug

When increasing the value of max_age parameter of OCSort class, I get the following error:

Traceback (most recent call last):
  File "/home/ml-machine/batin/easy-security_onprem/unused/tracker-tests/ocsort.py", line 66, in <module>
    main(parse_args())
  File "/home/ml-machine/batin/easy-security_onprem/unused/tracker-tests/ocsort.py", line 52, in main
    tracks = tracker.update(dets, im) # --> M X (x, y, x, y, id, conf, cls, ind)
  File "/home/ml-machine/miniconda3/envs/ublenv/lib/python3.10/site-packages/boxmot/utils/__init__.py", line 79, in wrapper
    tracks = self.update(instance, dets, im)
  File "/home/ml-machine/miniconda3/envs/ublenv/lib/python3.10/site-packages/boxmot/trackers/ocsort/ocsort.py", line 292, in update
    self.active_tracks[m[1]].update(dets[m[0], :5], dets[m[0], 5], dets[m[0], 6])
  File "/home/ml-machine/miniconda3/envs/ublenv/lib/python3.10/site-packages/boxmot/trackers/ocsort/ocsort.py", line 167, in update
    self.kf.update(convert_bbox_to_z(bbox))
  File "/home/ml-machine/miniconda3/envs/ublenv/lib/python3.10/site-packages/boxmot/motion/kalman_filters/ocsort_kf.py", line 485, in update
    self.unfreeze()
  File "/home/ml-machine/miniconda3/envs/ublenv/lib/python3.10/site-packages/boxmot/motion/kalman_filters/ocsort_kf.py", line 399, in unfreeze
    index1 = indices[-2]
IndexError: index -2 is out of bounds for axis 0 with size 1

Environment

Boxmot - 10.0.65
Python - 3.10.13 torch 2.1.2+cu118 CUDA:0 (RTX 3090 24GB)

Minimal Reproducible Example

    detector = YOLO(
        model="path/to/yolov8m.pt"
    ).to(device)
    tracker = OCSORT(
        max_age=60
    )
    kwargs = {'classes': 0}
    results = detector(input_filename, stream=True, **kwargs)

    for r in results:
        try:
            im = deepcopy(r.orig_img)
            annotator = Annotator(im)
            dets = r.boxes.data.cpu().numpy()
            tracks = tracker.update(dets, im) # --> M X (x, y, x, y, id, conf, cls, ind)
            for track in tracks:
                ...
@MABatin MABatin added the bug Something isn't working label May 6, 2024
@mikel-brostrom
Copy link
Owner

So it works with 30?

@J4BEZ
Copy link

J4BEZ commented May 7, 2024

I got same error while using HybridSORT.

in my case, it works very well with 30 and 40.
but if I increase max_age to 120, I got the same error occured😥

@mikel-brostrom
Copy link
Owner

I see. The max deque length for observation history is 50 so it makes sense that it works with 30 and 40, but not over 50

@MABatin
Copy link
Author

MABatin commented May 8, 2024

I see. The max deque length for observation history is 50 so it makes sense that it works with 30 and 40, but not over 50

Are you planning on making the max deque length dynamic as the max_age or could there be any downside to it?

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!

@github-actions github-actions bot added the Stale label May 19, 2024
@mikel-brostrom
Copy link
Owner

I see. The max deque length for observation history is 50 so it makes sense that it works with 30 and 40, but not over 50

Are you planning on making the max deque length dynamic as the max_age or could there be any downside to it?

Yup, I have it in my backlog 😄

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!

@github-actions github-actions bot added the Stale label May 30, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants