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

Regarding the code at line 86-90 in liif.py #47

Open
ShuGuoJ opened this issue Jun 15, 2022 · 5 comments
Open

Regarding the code at line 86-90 in liif.py #47

ShuGuoJ opened this issue Jun 15, 2022 · 5 comments

Comments

@ShuGuoJ
Copy link

ShuGuoJ commented Jun 15, 2022

"rel_cell = cell.clone()
rel_cell[:, :, 0] *= feat.shape[-2]
rel_cell[:, :, 1] *= feat.shape[-1]"

What does the code mean? Before that, rel_cell stores the proportion of 2 to crop_hr.shape. So, its multiplication resultant means what?

@shkarupa-alex
Copy link

As far as i understand:

cell = * 2 / [out_height, out_width]
rel_cell = cell * <input features height, width> = 2 * /

So rel_cell holds input-to-output scale for height and width as described in "Cell decoding" block of paper.

P.S.
I think cell decoding is useful for SR, but should be meaningless for most other tasks where input/output scale is constant.

@axhiao
Copy link

axhiao commented Sep 7, 2022

Hi guys, @shkarupa-alex @ShuGuoJ do you think the formula should be rel_cell[:, :, 0] *= feat.shape[-2]/2? Because the side length of each grid is 2/N

@ShuGuoJ
Copy link
Author

ShuGuoJ commented Sep 9, 2022

Why is the side length of each grid 2/N? The N means what here.

@axhiao
Copy link

axhiao commented Sep 9, 2022

N means height or width of the feature map

@Zhaohuai-L
Copy link

Does it mean the decell is the 2/scale actually?

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

4 participants