XPixelGroup/HAT

Question about the forward method

antonelse opened this issue · 3 comments

Hi, I'm trying using the HAT network outside the basicSR framework for a custom task.
As a model I'm using the one in /hat/archs/hat_arch.py here.

I'm curious about the forward method of this model (line 971), since, if the field upsampler is not pixelshuffle, it seems that it does not perform any forward pass on the building blocks of the model.
If I'm not wrong, the forward pass of all the some blocks are performed by the function forward_features (line 950), that is executed only if upsampler is pixelshuffle.
In addition, if pixelshuffle, at inference time the network does not perform ad upscaling, but the input shape remains the same.
I'm wondering if this is the correct behaviour, or I'm missing something ;)

I'm also courious about the others fiels for the recostruction module (upsampler), like 'pixelshuffle'/'pixelshuffledirect'/'nearest+conv'/None.

Sorry if I'm asking something trivial, but I'm new to this framework and I'm trying to understand how it works.

@antonelse The codes are simplified by only providing one choice of 'pixelshuffle' upsampling. You can refer to the codes of other choices for upsampling in https://github.com/XPixelGroup/BasicSR/blob/master/basicsr/archs/swinir_arch.py. Our provided pretrained models are based on 'pixelshuffle' upsampling.

Thanks @chxy95 !

So, the performance of the HAT paper are all based on pixelshuffle upsampling ?
Is there a reason in why you decide to not put it as a default value on the code (in the upsampler), and leave it as None ?

Thanks for the quick response ;)

@chxy95 The performance of the HAT paper are all based on pixelshuffle upsampling. It is a default choice and I did not provide other choices in the codes. Keeping this interface just out of inertia.