Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

a coding mistake #47

Open
fenglv12345 opened this issue Jun 1, 2019 · 4 comments
Open

a coding mistake #47

fenglv12345 opened this issue Jun 1, 2019 · 4 comments

Comments

@fenglv12345
Copy link

mistake as below
https://github.com/Duankaiwen/CenterNet/blob/master/sample/utils.py

def gaussian_radius(det_size, min_overlap):

height, width = det_size



a1  = 1

b1  = (height + width)

c1  = width * height * (1 - min_overlap) / (1 + min_overlap)

sq1 = np.sqrt(b1 ** 2 - 4 * a1 * c1)

r1  = (b1 + sq1) / 2



a2  = 4

b2  = 2 * (height + width)

c2  = (1 - min_overlap) * width * height

sq2 = np.sqrt(b2 ** 2 - 4 * a2 * c2)

r2  = (b2 + sq2) / 2



a3  = 4 * min_overlap

b3  = -2 * min_overlap * (height + width)

c3  = (min_overlap - 1) * width * height

sq3 = np.sqrt(b3 ** 2 - 4 * a3 * c3)

r3  = (b3 + sq3) / 2

return min(r1, r2, r3)

And the correct one
please reference to the
https://github.com/princeton-vl/CornerNet/blob/master/sample/utils.py
like this

def gaussian_radius(det_size, min_overlap):

height, width = det_size



a1  = 1

b1  = (height + width)

c1  = width * height * (1 - min_overlap) / (1 + min_overlap)

sq1 = np.sqrt(b1 ** 2 - 4 * a1 * c1)

r1  = (b1 - sq1) / (2 * a1)



a2  = 4

b2  = 2 * (height + width)

c2  = (1 - min_overlap) * width * height

sq2 = np.sqrt(b2 ** 2 - 4 * a2 * c2)

r2  = (b2 - sq2) / (2 * a2)



a3  = 4 * min_overlap

b3  = -2 * min_overlap * (height + width)

c3  = (min_overlap - 1) * width * height

sq3 = np.sqrt(b3 ** 2 - 4 * a3 * c3)

r3  = (b3 + sq3) / (2 * a3)

return min(r1, r2, r3)

so i hope you can give you Mathematical formula derivation in the readme.md
because which is not same with mine

@Duankaiwen
Copy link
Owner

@fenglv12345
Copy link
Author

@Duankaiwen i have seen that,i mean that your r1 and r2 are different from the cornernet. Check it carefully.
by the way,maybe cornernet's mathmatical formulas are not correct. I have given my mathmatical formulas.
as below
princeton-vl/CornerNet#110

@Duankaiwen
Copy link
Owner

Thanks for your mathmatical formulas, i have seen that. The author of CornerNet modified the codes, and i didn't notice this.
%UHV}1%KP JWJ1HS4V)N4O4

@fenglv12345
Copy link
Author

I have already updated the formulas.
princeton-vl/CornerNet#110

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants