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

deepSORT_tracking_v2 will raise value error because lengths of lists in results are not the same #5

Open
chuanwise opened this issue Dec 15, 2023 · 0 comments

Comments

@chuanwise
Copy link

Near the line 251 of deepSORT/deep_sort_app_v2.py:

for i, track in enumerate(tracker.tracks):
    if not track.is_confirmed() or track.time_since_update > 1:
        continue
    bbox = track.to_tlwh()
    track_res = [frame_idx, track.track_id, bbox[0], bbox[1], bbox[2],
            bbox[3]]
    if i not in track2det.keys():
        results.append(track_res)
        continue
    track_res += [detections[track2det[i]].confidence]
    track_res += [detections[track2det[i]].label]
    track_res += list(detections[track2det[i]].tlwh)
    track_res += list(detections[track2det[i]].feature)
    results.append(track_res)

The are 2 statements calling results.append(track_res). The first one always appends a list with length 6, but the last one is 1036, which will make np.array(results) fail:

Traceback (most recent call last):
  File "/home/chuanwise/develop/projects/VidVRD-tracklets/deepSORT/deepSORT_tracking_v2.py", line 94, in <module>
    run(
  File "/home/chuanwise/develop/projects/VidVRD-tracklets/deepSORT/deep_sort_app_v2.py", line 244, in run
    visualizer.run(frame_callback)
  File "/home/chuanwise/develop/projects/VidVRD-tracklets/deepSORT/application_util/visualization.py", line 80, in run
    frame_callback(self, self.frame_idx)
  File "/home/chuanwise/develop/projects/VidVRD-tracklets/deepSORT/deep_sort_app_v2.py", line 185, in frame_callback
Traceback (most recent call last):
  File "/home/chuanwise/develop/projects/VidVRD-tracklets/deepSORT/deepSORT_tracking_v2.py", line 94, in <module>
    run(
  File "/home/chuanwise/develop/projects/VidVRD-tracklets/deepSORT/deep_sort_app_v2.py", line 254, in run
    res = np.array(results)
          ^^^^^^^^^^^^^^^^^
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (389,) + inhomogeneous part.        
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant