ConvLSTM-PyTorch icon indicating copy to clipboard operation
ConvLSTM-PyTorch copied to clipboard

Blurry results

Open tcapelle opened this issue 5 years ago • 0 comments
trafficstars

Hello, awesome repo. I have been playing with various convlstm/gru implementation as we don't have an official one in Pytorch. I am having trouble getting good images as output. I am unable to get sharp images as the ones you showed. I modified your model to output 2 classes per image, to produce binary values and train with CrossEntropy (I just put to 1 all pixels greater that 0.5, and zero the others). I am also currently trying this UpsampleBlock from fastai2 Unet for the decoder with good results:

class UpsampleBlock(Module):
    "A quasi-UNet block, using `PixelShuffle_ICNR upsampling`."
    @delegates(ConvLayer.__init__)
    def __init__(self, in_ch, out_ch, final_div=True, blur=False, act_cls=defaults.activation,
                 self_attention=False, init=nn.init.kaiming_normal_, norm_type=None, **kwargs):
        self.shuf = PixelShuffle_ICNR(in_ch, in_ch//2, blur=blur, act_cls=act_cls, norm_type=norm_type)
        ni = in_ch//2
        nf = out_ch
        self.conv1 = ConvLayer(ni, nf, act_cls=act_cls, norm_type=norm_type, **kwargs)
        self.conv2 = ConvLayer(nf, nf, act_cls=act_cls, norm_type=norm_type,
                               xtra=SelfAttention(nf) if self_attention else None, **kwargs)
        self.relu = act_cls()
        apply_init(nn.Sequential(self.conv1, self.conv2), init)

    def forward(self, up_in):
        up_out = self.shuf(up_in)
        return self.conv2(self.conv1(up_out))

tcapelle avatar Jul 09 '20 15:07 tcapelle