Skip to content

Class none person, how to remove it ? #699

Answered by SkalskiP
Rasantis asked this question in Q&A
Discussion options

You must be logged in to vote

@Rasantis

It looks like the None is the tracker_id value associated with the given detection. Probably YOLOv8 can't assign the correct tracker_id so it leaves it as None.

You can:

  1. Skip tracker_id when printing the labels. You can do that by updating:
# old line
labels = [f"{d[4]} {self.model.model.names[d[3]]} {d[2]:0.2f}" for d in detections_filtered]

# new line
labels = [f"{self.model.model.names[d[3]]} {d[2]:0.2f}" for d in detections_filtered]
  1. Filter out detections with tracker_id equal to None.
detections_filtered = detections[detections.tracker_id != None]

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@Rasantis
Comment options

@SkalskiP
Comment options

Answer selected by SkalskiP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants
Converted from issue

This discussion was converted from issue #686 on December 28, 2023 12:25.