In the following code there are unnecessary calculations being performed as the same variable cancels itself out.
|
const float ua = (tlwh[0] + tlwh[2] - tlwh[0] + 1) * (tlwh[1] + tlwh[3] - tlwh[1] + 1) + box_area - iw * ih; |
Instead it should be.
const float ua = (tlwh[2] + 1) * (tlwh[3] + 1) + box_area - iw * ih;