Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Bug report on densepose_cocoeval.py #182

Closed
penincillin opened this issue Jan 14, 2019 · 3 comments
Closed

Bug report on densepose_cocoeval.py #182

penincillin opened this issue Jan 14, 2019 · 3 comments

Comments

@penincillin
Copy link

penincillin commented Jan 14, 2019

Hi, I am currently reading the source code of densepose, and I think there might be a bug in detectron/datasets/densepose_cocoeval.py. Don't be nervous, this bug won't affect the result of the code, it will just confuse people like me who try to read your code :)
From line 378 to line 397 I think some 'x' and 'y' are messed up and the code with correct use of 'x' and 'y' should be :
Line 378~379:

dy = dt['bbox'][3] 
dx = dt['bbox'][2]

Line 382~383

py = ( dp_y + g_[1] - dt['bbox'][1]).astype(np.int)
px = ( dp_x + g_[0] - dt['bbox'][0]).astype(np.int)

Line 395~397

ipoints = dt['uv'][0, py, px]
upoints = dt['uv'][1, py, px]/255. # convert from uint8 by /255.
vpoints = dt['uv'][2, py, px]/255.

I would appreciate if you reply me.
Thanks !

@vkhalidov
Copy link
Contributor

@penincillin Indeed, the names x and y are partly interchanged here. Bounding box dimensions dx and dy computed on lines 378-379 and point coordinates px and py computed on lines 382-383 refer in fact to y and x coordinates respectively. At the same time, dp_x and dp_y variables refer to x and y respectively. This creates syntactic confusion, but the code is semantically correct.

@penincillin
Copy link
Author

Thanks for your reply !
I got it.

@Johnqczhang
Copy link

@vkhalidov @penincillin I fixed this confusion and simplified the code in #203, which makes the code understood more easily and has no effect on the results.

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

No branches or pull requests

3 participants