ltkong218 / IFRNet

IFRNet: Intermediate Feature Refine Network for Efficient Frame Interpolation (CVPR 2022)
MIT License
259 stars 23 forks source link

The generated image sizes have changed #8

Open Heroandzhang opened 2 years ago

Heroandzhang commented 2 years ago

Hi, when I test the middlebury dataset, the sizes of the generated images and the ground truth are different, what is the reason for this, and how should I correct it?

ltkong218 commented 2 years ago

For Middlebury dataset, we zero pad each input frame pair to spatial size of 640 x 480, and here is the key implementation code.

I0_pad = torch.zeros([1, 3, 480, 640]).to(device)
I2_pad = torch.zeros([1, 3, 480, 640]).to(device)
h, w = I0.shape[-2:]
I0_pad[:, :, :h, :w] = I0
I2_pad[:, :, :h, :w] = I2
I1_pred_pad = model.inference(I0_pad, I2_pad, embt)
I1_pred = I1_pred_pad[:, :, :h, :w]

Also, I have added the evaluation script on Middlebury Other dataset Middlebury_Other.py in this repository.