Skip to content

Index error: index 1 is out of bounds for axis 1 with size 1 #14

@IlkerKadir

Description

@IlkerKadir

Some videos cause Index error: index 1 is out of bounds for axis 1 with size 1. To solve this, it might be a good idea to pass an empty (0,5) array to the tracker rather than an empty list: if there are no detections.

I suggest adding this in your main.py to solve this issue :

if len(detections_) == 0:
    # pass an explicit (0,5) shape
    track_ids = mot_tracker.update(np.empty((0, 5)))
else:
    # pass Nx5 as intended
    track_ids = mot_tracker.update(np.asarray(detections_)) 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions