Alan-D-Chen / CDIoU-CDIoUloss

🔥CDIoU and CDIoU loss is like a convenient plug-in that can be used in multiple models. CDIoU and CDIoU loss have different excellent performances in several models such as Faster R-CNN, YOLOv4, RetinaNet and . There is a maximum AP improvement of 1.9% and an average AP of 0.8% improvement on MS COCO dataset, compared to traditional evaluation-feedback modules. Here we just use as an example to illustrate the code.
Other
27 stars 6 forks source link

Compute MBR Diagonal #1

Open JasperKirk opened 3 years ago

JasperKirk commented 3 years ago

This is a really great repo and I'm enjoying reading it.But I have a question about Compute MBR Diagonal. Why Am,Bm,Cm,Dm are all use torch.max() image

Alan-D-Chen commented 3 years ago

Well done. At first, you should know what the MBR means and how to get MBR.

JasperKirk commented 3 years ago

1.The MBR is Minimum bounding rectangle, it should be the dotted area in the picture on the paper(the follow picture). When you calculate WY,I guess your code m and n are the coordinates of the upper left and lower right corners of the box(m={A,C},n={E,G}). If all torch.max() is used, is it calculated as | EG |? If I guess wrong or be misunderstood, please feel free to enlighten me image

2.Why use anchor and target to calculate diou instead of pred and target? https://github.com/Alan-D-Chen/CDIoU-CDIoUloss/blob/5b911bc2cfe39c671a4e514d06ea73ad1f53292e/atss_core/modeling/rpn/atss/loss.py#L76 dious = box_dious(anchor, target)

3.0 ≤ diou < 1, How is the upper bound (diou < 1)calculated?

  1. -1≤GIoU≤1, Lgiou = 1 -GIoU, so 0 ≤ Lgiou ≤2, why if LIoUs = LGIoU, then −1 ≤ LCDIoU < 2?

Thank you again for your excellent work, and if my understanding is wrong, please point it out for me.

hujunchao commented 3 years ago

I think Am and Bm should use torch.min(), and Cm and Dm should use torch.max(). @JasperKirk @Alan-D-Chen

JasperKirk commented 3 years ago

I agree with you.@hujunchao

Alan-D-Chen commented 3 years ago

Sorry, I have updated my code. Q1 I uploaded the code V1.0 by mistake. There is code V3.0. Q2 "Anchor" is just a code, the substance is the same as you think。 Q3 It is easy. Q4 ..........