-
-
Notifications
You must be signed in to change notification settings - Fork 15.9k
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
Yolov5 loss function #6316
Comments
👋 Hello @hyeonmin11, thank you for your interest in YOLOv5 🚀! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution. If this is a 🐛 Bug Report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you. If this is a custom training ❓ Question, please provide as much information as possible, including dataset images, training logs, screenshots, and a public link to online W&B logging if available. For business inquiries or professional support requests please visit https://ultralytics.com or email Glenn Jocher at glenn.jocher@ultralytics.com. RequirementsPython>=3.6.0 with all requirements.txt installed including PyTorch>=1.7. To get started: git clone https://github.com/ultralytics/yolov5 # clone
cd yolov5
pip install -r requirements.txt # install EnvironmentsYOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
StatusIf this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training (train.py), validation (val.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu every 24 hours and on every commit. |
@hyeonmin11 seems like you've answered your own question. |
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 ⭐! |
Hi, Can someone tell me wich loss function yolov5 used? |
Hello @YasmineeBa, YOLOv5 by default uses the GIoU loss function, which stands for Generalized Intersection over Union. The loss function is defined in However, the loss function can also be configured to use other variants of IoU-loss including CIoU-loss and DIoU-loss by changing the configuration file for YOLOv5. Please refer to https://docs.ultralytics.com/yolov5/loss for more information on YOLOv5’s loss function. |
thank you
Le jeu. 13 avr. 2023 à 23:56, Glenn Jocher ***@***.***> a
écrit :
… Hello @YasmineeBa <https://github.com/YasmineeBa>, YOLOv5 by default uses
the GIoU loss function, which stands for Generalized Intersection over
Union.
The loss function is defined in yolov5/models/yolo.py file, which can be
found at https://github.com/ultralytics/yolov5/blob/master/models/yolo.py
on line 252.
However, the loss function can also be configured to use other variants of
IoU-loss including CIoU-loss and DIoU-loss by changing the configuration
file for YOLOv5.
Please refer to https://docs.ultralytics.com/yolov5/loss for more
information on YOLOv5’s loss function.
—
Reply to this email directly, view it on GitHub
<#6316 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APK2TZNHPYTRNXH5Y36VZWTXBCABHANCNFSM5MCZIDNA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
You're welcome, @YasmineeBa! If you have any other questions or concerns, feel free to reach out again. |
Hi @glenn-jocher, Sorry for asking so many questions, Just doing some studying :)! In this issue you say you use GIoU but according to information from other issues I gather you have said that you use MSE for Regression loss, BCE/Focal for Confidence loss, and CE for classification. May I know how GIoU is involved in this? |
Hello @imPdhar, no worries at all! Questions are a great way to learn, and I'm here to help. 😊 You're correct in your understanding. In YOLOv5, the loss function is a combination of several components tailored to different aspects of the detection task:
The combination of these loss components allows YOLOv5 to effectively learn to detect and classify objects in images. GIoU specifically helps in refining the accuracy of the bounding box predictions, making it a crucial part of the overall loss function. I hope this clarifies how GIoU is involved alongside other loss components in YOLOv5. If you have more questions, feel free to ask! |
Thank you @glenn-jocher i use yolov5s for my university capstone project. Appriciate you for actively clarifying all questions |
@litnguyen you're very welcome! I'm delighted to hear YOLOv5s is part of your university capstone project. If you have any more questions or need further clarification as you progress, don't hesitate to reach out. Best of luck with your project! 😊👍 |
Search before asking
Question
Does yolov5 loss function uses CIOU loss?
I just thought yolov5 deals with GIOU loss or iou,
But in loss.py Computeloss,
iou = bbox_iou(pbox.T, tbox[i], x1y1x2y2=False, CIoU=True) # iou(prediction, target)
lbox += (1.0 - iou).mean() # iou loss
I saw this.
Additional
No response
The text was updated successfully, but these errors were encountered: