-
-
Notifications
You must be signed in to change notification settings - Fork 16.7k
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
multi-class detection vs few-class detection ? #5170
Comments
@hoangkhoiLE yes the fewer classes the model trains on the better it will perform at each class naturally. I've created PR #5172 to allow for class filtering by manually updating datasets.py. To train on person and bag classes only set this variable in datasets.py accordingly: include_class = [0, 26] # filter labels to include only these classes (optional) |
@hoangkhoiLE good news 😃! Your original issue may now be fixed ✅ in PR #5172 which is now merged. To receive this update:
Thank you for spotting this issue and informing us of the problem. Please let us know if this update resolves the issue for you, and feel free to inform us of any other issues you discover or feature requests that come to mind. Happy trainings with YOLOv5 🚀! |
Hello @glenn-jocher, thank you for fixing this ! I'll try it soon. Just one more question, in your opinion/experience, if I want to train a model on only 2 classes (with the example of the amazing hoangkhoiLE, person & bag), is it better to use the pretrained weights or train the model from scratch ? |
@MattVAD for most use cases (smaller datasets) starting from pretrained models will deliver better results. If you have large (COCO-size) dataset, then training from scratch may also produce good results. I would train both ways if I were you to compare. |
❔Question
Dear @glenn-jocher,
I want to do detection on person and bag object which are two class from COCO dataset. So, if i want to get a model better performance in only person and bag, do i need to retrain a model with label filtered between that two class and remove label of other classes ? Can you give me an advise in this situation ? Thank in advance !
Best regard !
Additional context
The text was updated successfully, but these errors were encountered: