-
-
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
Ensembling of yolov5 and yolov8 #12732
Comments
@humairaneha hi there! 👋 Yes, you can ensemble YOLOv5 with YOLOv8 models. Ensembling different models involves running each model separately on the same input and then combining their predictions. The combination can be done by averaging the bounding box coordinates and confidence scores or by using more sophisticated methods like Non-Maximum Suppression (NMS). For the best results, ensure that both models are well-calibrated and that their confidence scores are comparable. You might need to experiment with different ensembling techniques to find what works best for your specific use case. For more details on how to implement this, you can refer to our documentation on custom inference scripts and post-processing steps. Good luck with your ensembling! 😊 |
Thank you so much. One thing I am confused about. Can I use the custom yolov8.pt the same way I used custom yolov5.pt in your ultralytics yolov5 repo? Load YOLOv8 modelyolov8_weights = "path_to_yolov8_weights.pt" Run inference with both modelspred_yolov5 = model(im, augment=augment, visualize=visualize) Combine predictionspred_combined = combine_predictions(pred_yolov5, pred_yolov8) Perform non-maximum suppression on combined predictionspred_combined = non_max_suppression(pred_combined, conf_thres, iou_thres, classes, agnostic_nms, max_det=max_det) like this? |
@humairaneha, the code snippet you've provided is conceptually correct for ensembling models. However, YOLOv8 is not part of the Ultralytics YOLOv5 repository, and the YOLOv5 codebase is specifically tailored for YOLOv5 models. If YOLOv8 has a different architecture or requires different preprocessing, the code may not be directly compatible. You would need to ensure that the YOLOv8 model can be loaded and used in a similar manner to YOLOv5, which may require adjustments to the code or the use of a separate inference script that is compatible with YOLOv8. Additionally, you would need to handle the outputs of both models in a way that they can be combined effectively, considering any differences in output format. If YOLOv8 follows a similar implementation and output format as YOLOv5, you might be able to use the same functions with minor modifications. Otherwise, you'll need to adapt the code to accommodate the differences between the two models. Remember to test the combined inference thoroughly to ensure that the models are correctly ensembled and the predictions are as expected. Good luck with your implementation! 😄 |
@humairaneha have you got success with implementation of ensemble of yolov5 and yolov8? |
👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help. For additional resources and information, please see the links below:
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 YOLO 🚀 and Vision AI ⭐ |
Hi @KAKAROT12419! 😊 If you've successfully implemented the ensemble of YOLOv5 and YOLOv8, that's great! If you're encountering any issues or have specific questions about the process, feel free to share them here. We're here to help! |
Search before asking
Question
Can i ensemble yolov5 model with a yolov8 model. both are trained on custom dataset?
Additional
No response
The text was updated successfully, but these errors were encountered: