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

feat(ByteTrack): Allow ByteTrack to track detection without class ids #1618

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion supervision/tracker/byte_tracker/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,16 @@ def callback(frame: np.ndarray, index: int) -> np.ndarray:
```
"""

num_rows = detections.xyxy.shape[0]
class_ids = np.full(num_rows, -5)
if detections.class_id is not None:
class_ids = detections.class_id

tensors = np.hstack(
(
detections.xyxy,
detections.confidence[:, np.newaxis],
detections.class_id[:, np.newaxis],
class_ids[:, np.newaxis],
)
)
tracks = self.update_with_tensors(tensors=tensors)
Expand Down