ultralytics / yolov5

YOLOv5 🚀 in PyTorch > ONNX > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
50.33k stars 16.25k forks source link

Some Questions about default Regression Loss Implementations #1113

Closed cydiachen closed 4 years ago

cydiachen commented 4 years ago

❔Question

Thank you for the excellent job of yolov5. I have read your code and inspired a lot. However, I found that it is confusing that the regression loss in your code. In ./utils/general.py, you kindly provided three types of iou loss for us. But i Find that inside compute_loss function, you use bbox_iou() with CIoU= True, but you annotated this line as giou. It is really confusing for us to understand. Would you mind telling me the real configurations or the reason you choose CIoU mode of bbox_iou() for giou? THX a lot.

Additional context

github-actions[bot] commented 4 years ago

Hello @cydiachen, thank you for your interest in our work! Please visit our Custom Training Tutorial to get started, and see our Jupyter Notebook Open In Colab, Docker Image, and Google Cloud Quickstart Guide for example environments.

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 model or data training question, please note Ultralytics does not provide free personal support. As a leader in vision ML and AI, we do offer professional consulting, from simple expert advice up to delivery of fully customized, end-to-end production solutions for our clients, such as:

For more information please visit https://www.ultralytics.com.

glenn-jocher commented 4 years ago

@cydiachen yes you are correct. See https://github.com/ultralytics/yolov5/issues/762 for a TODO on this.

In terms of box regression metrics CIoU may perform slightly better on custom datasets per user feedback.

cydiachen commented 4 years ago

@cydiachen yes you are correct. See #762 for a TODO on this.

In terms of box regression metrics CIoU may perform slightly better on custom datasets per user feedback.

Thx, Your reply cleared up my doubt. Thank you for your reply.

glenn-jocher commented 4 years ago

@cydiachen I've opened PR #1120 to address this. Please review and comment there.