yinboc / liif

Learning Continuous Image Representation with Local Implicit Image Function, in CVPR 2021 (Oral)
https://yinboc.github.io/liif/
BSD 3-Clause "New" or "Revised" License
1.28k stars 145 forks source link

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

Open ShuGuoJ opened 2 years ago

ShuGuoJ commented 2 years ago

"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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

axhiao commented 2 years ago

N means height or width of the feature map

Zhaohuai-L commented 1 year ago

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