Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Unnecessary calculations which add then subtract same variable #18

Open
swdee opened this issue Aug 3, 2024 · 0 comments
Open

Unnecessary calculations which add then subtract same variable #18

swdee opened this issue Aug 3, 2024 · 0 comments

Comments

@swdee
Copy link

swdee commented Aug 3, 2024

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; 
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant