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

DeepOCSORT: missing 2 required positional arguments: 'w' and 'h when using 'centroid' as associate function #1372

Closed
1 task done
grassjelly opened this issue Mar 23, 2024 · 3 comments
Labels
bug Something isn't working Stale

Comments

@grassjelly
Copy link

grassjelly commented Mar 23, 2024

Search before asking

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

Yolo Tracking Component

Tracking

Bug

I'm using DeepOCSort as a tracker with an external object detector. The tracking works for a few seconds but hits an error after a while. I think it's when no objects are detected on the frame.

Error:
File "/usr/local/lib/python3.8/dist-packages/boxmot/trackers/deepocsort/deep_ocsort.py", line 462, in update
object-tracker | [tracked_bbox_publisher.py-1] iou_left = self.asso_func(left_dets, left_trks)
object-tracker | [tracked_bbox_publisher.py-1] TypeError: centroid_batch() missing 2 required positional arguments: 'w' and 'h

Environment

  • Yolo Tracking v 10.0.52

Minimal Reproducible Example

This is my update function

def update(self, detections, img) :
    tracked_objects = []
    if len(detections) == 0:
        detections = np.empty((0, 6))
    else:
        detections = np.array(detections)

    tracks = self._tracker.update(detections, img)
    if tracks.shape[0] != 0:
        xyxys = tracks[:, 0:4].astype('int') # float64 to int
        ids = tracks[:, 4].astype('int') # float64 to int
        confs = tracks[:, 5]
        clss = tracks[:, 6].astype('int') # float64 to int

        for xyxy, id, conf, cls in zip(xyxys, ids, confs, clss):
            tracked_objects.append([
                xyxy[0],
                xyxy[1],
                xyxy[2],
                xyxy[3],
                id,
                cls,
                conf
            ])

    return tracked_objects

and here's my config:

DEEP_OC_SORT:
  reid_weights: 'RESNET'
  device_id: 0                # Cuda GPU ID
  fp16: True                  # Enable FP16
  max_age: 1200
  per_class: True
  det_thresh: 0.3
  max_age: 30
  min_hits: 3
  iou_threshold: 0.3
  delta_t: 3
  asso_func: "centroid" #https://github.com/mikel-brostrom/yolo_tracking/issues/1246
  inertia: 0.2
  w_association_emb: 0.5
  alpha_fixed_emb: 0.95
  aw_param: 0.5
  embedding_off: False
  cmc_off: False
  aw_off: False
  new_kf_off: False
@grassjelly grassjelly added the bug Something isn't working label Mar 23, 2024
@grassjelly
Copy link
Author

grassjelly commented Mar 23, 2024

Just checked the code, should this line https://github.com/mikel-brostrom/yolo_tracking/blob/master/boxmot/trackers/deepocsort/deep_ocsort.py#L466 be using run_asso_func to prevent this from breaking similar to this https://github.com/mikel-brostrom/yolo_tracking/blob/master/boxmot/utils/association.py#L146 call?

something like:

iou_left = run_asso_func(self.asso_func, left_dets, left_trks, img.shape[1], img.shape[0])

@userkw
Copy link

userkw commented Mar 26, 2024

@grassjelly can i ask you when i use this cmd line :
python tracking/track.py --tracking-method deepocsort
I changed the parameter value, like min_hit, from 1 to 3 in the file deepocsort.yaml, but it doesn't seem to consider it. It's like I didn't change anything. Any help?

Copy link

github-actions bot commented Apr 6, 2024

👋 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

2 participants