ultralytics icon indicating copy to clipboard operation
ultralytics copied to clipboard

Filter prediction by class using CLI

Open rusvagzur opened this issue 2 years ago • 3 comments

Search before asking

  • [X] I have searched the YOLOv8 issues and discussions and found no similar questions.

Question

Hi there Ultralytics,

Is it somehow possible to filter the predictions by class using CLI? For example, I only want to predict the class car from a video.

Many thanks

Additional

No response

rusvagzur avatar Jan 18 '23 15:01 rusvagzur

@rusvagzur no, not out of the box, you'd have to filter inference results after inference runs.

glenn-jocher avatar Jan 18 '23 16:01 glenn-jocher

@rusvagzur no, not out of the box, you'd have to filter inference results after inference runs.

Sorry if I ask again about this, but in yolov5 it was possible to filter by class in the cli and in python? Will it be possible in python and v8 too? thanks

for example like this python detect.py --weights yolov5x.pt --view-img --class 0 1 2 3 4 5 6 7 8 9 --nosave --device 0 --source https://www.youtube.com/watch?v=cZENtQgRVxk

g-i-o-r-g-i-o avatar Jan 18 '23 18:01 g-i-o-r-g-i-o

@GianniGi exactly, that's what I meant

rusvagzur avatar Jan 18 '23 20:01 rusvagzur

@GianniGi Cheak out the recent modification for filtering the class filter

prince0310 avatar Jan 22 '23 09:01 prince0310