Zzh-tju / DIoU

Distance-IoU Loss: Faster and Better Learning for Bounding Box Regression (AAAI 2020)
310 stars 50 forks source link

Question about calculating the derivative of DIoU #24

Open sweet-Icecream opened 10 months ago

sweet-Icecream commented 10 months ago

d=(A(1)-B(1))(A(1)-B(1))+(A(2)-B(2))(A(2)-B(2)); s.dx=1(2(B(1)-A(1))C-(2CCwCw.dx+2CChCh.dx)d) / (C C); s.dy=1(2(B(2)-A(2))C-(2CCwCw.dy+2CChCh.dy)d) / (C C); s.dw= 1(2CCwCw.dw+2CChCh.dw)d / (C C); s.dh= 1(2CCwCw.dh+2CChCh.dh)d / (C C);

In line 72-76 in dDIOU.m, I was wondering about why s.dw and s.dh don't have negative sign. S = ((B(1)-A(1))^2 + (B(2)-A(2))^2)/C, then I think that dS/dw and dS/dh should have zero gradient on first term and negative sign on second term of fraction differential equation. (A/B)' = (A'B - AB')/B^2