ServiceNow / HighRes-net

Pytorch implementation of HighRes-net, a neural network for multi-frame super-resolution, trained and tested on the European Space Agency’s Kelvin competition. This is a ServiceNow Research project that was started at Element AI.
https://www.elementai.com/news/2019/computer-enhance-please
Other
277 stars 51 forks source link

Lanczos code crashes #15

Open nonick2k23 opened 1 year ago

nonick2k23 commented 1 year ago

Hi,

Using PROBA-V dataset, the code crashes in lanczos file with this error:

RuntimeError: Expected 2D (unbatched) or 3D (batched) input to conv1d, but got input of size: [1, 16, 202, 202]

Why insight on what might cause this?

milder-z commented 1 year ago

I encountered the same problem. And sadly, there seems to be no pre-trained model provided here.

yunseok624 commented 8 months ago

Did someone solve the problem?

jakubsadel commented 7 months ago

I thought that here it was enough to remove the transpose, because it looked like it disturbed the dimensionality, but nevertheless it did nothing :/.

def transform(self, theta, I, device="cpu"):
        '''
        Shifts images I by theta with Lanczos interpolation.
        Args:
            theta : tensor (B, 2), translation params
            I : tensor (B, C_in, H, W), input images
        Returns:
            out: tensor (B, C_in, W, H), shifted images
        '''

        self.theta = theta
        new_I = lanczos.lanczos_shift(img=I.transpose(0, 1), #delate transpose
                                      shift=self.theta.flip(-1),  # (dx, dy) from register_batch -> flip
                                      a=3, p=5)[:, None]
        return new_I