Closed lucasjinreal closed 4 years ago
I don't know. You can use g/d/ciou in the loss function by specifying it here. To use DIoU you would pass DIoU=True
in place of the current GIoU on L413.
Update for Yolov5: This is now inloss.py
on line 141
:
Default (CIoU): Paper
iou = bbox_iou(pbox, tbox[i], CIoU=True).squeeze() # iou(prediction, target)
GIoU: Paper
iou = bbox_iou(pbox, tbox[i], GIoU=True).squeeze() # iou(prediction, target)
DIoU: Paper
iou = bbox_iou(pbox, tbox[i], DIoU=True).squeeze() # iou(prediction, target)
The definition of bbox_iou
is on line 216 in metrics.py
.
@aktiver thanks for your update! The implementation of DIoU, GIoU, and CIoU are all available in the loss.py
file, and the bbox_iou
definition can be found in the metrics.py
file. You can now easily choose and use the desired IoU metric in your YOLOv5 implementation. If you have further questions or need assistance, feel free to reach out.
Will dIOU obtain a better result then gIOU?