-
-
Notifications
You must be signed in to change notification settings - Fork 16.3k
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
Filter results from predictions #6213
Comments
@maurokenny see PyTorch Hub tutorial for class filtering: Inference SettingsYOLOv5 models contain various inference attributes such as confidence threshold, IoU threshold, etc. which can be set by: model.conf = 0.25 # NMS confidence threshold
iou = 0.45 # NMS IoU threshold
agnostic = False # NMS class-agnostic
multi_label = False # NMS multiple labels per box
classes = None # (optional list) filter by class, i.e. = [0, 15, 16] for COCO persons, cats and dogs
max_det = 1000 # maximum number of detections per image
amp = False # Automatic Mixed Precision (AMP) inference
results = model(imgs, size=320) # custom inference size YOLOv5 Tutorials
Good luck 🍀 and let us know if you have any other questions! |
In this case I have to change the |
👋 Hello, this issue has been automatically marked as stale because it has not had recent activity. Please note it will be closed if no further activity occurs. Access additional YOLOv5 🚀 resources:
Access additional Ultralytics ⚡ resources:
Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed! Thank you for your contributions to YOLOv5 🚀 and Vision AI ⭐! |
Hi @maurokenny , were you able to figure out how to filter predictions? I'm trying to save false positives and false negatives. Thanks! |
👋 Hello, this issue has been automatically marked as stale because it has not had recent activity. Please note it will be closed if no further activity occurs. Access additional YOLOv5 🚀 resources:
Access additional Ultralytics ⚡ resources:
Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed! Thank you for your contributions to YOLOv5 🚀 and Vision AI ⭐! |
Search before asking
Question
From the code:
if I run
results.render()
it will show all detected boxes.How can I modify the
results
variable to filter just some classes (e.g.: classes 0 and 1) and then runresults.render()
to show just the filtered classes? Without doingresults = model(imgs)
again.Thanks
Additional
No response
The text was updated successfully, but these errors were encountered: