xinntao / EDVR

Winning Solution in NTIRE19 Challenges on Video Restoration and Enhancement (CVPR19 Workshops) - Video Restoration with Enhanced Deformable Convolutional Networks. EDVR has been merged into BasicSR and this repo is a mirror of BasicSR.
https://github.com/xinntao/BasicSR
1.49k stars 318 forks source link

ask about the video input size #48

Open Alan-QiZhi opened 5 years ago

Alan-QiZhi commented 5 years ago

hello ,I tried your models for my own imgs. but i got an error ,then i change the input img size .it worked .so, i want to know whether the input size must be 1280 * 720 if i use the models that you privide?

xinntao commented 5 years ago

The height and weight of the input images should be a multiplication of 4. Refer to #25.

Alan-QiZhi commented 5 years ago

ok,thanks.

sjscotti commented 5 years ago

Hi I am anxious to try out your code with my own images and I have modified the test_Vid4_REDS4_with_GT.py to not need GT images for data_mode = 'blur_comp'. It works for images the same size as the REDS4 datasets - 1280 by 720 - however, it does not work for images having half these dimensions - 640 by 360. The smaller dimensions that don't work are divisible by 4, so is there some other setting needed for them to be handled by the code? Thanks in advance!

sjscotti commented 5 years ago

As some additional information to my problem with 640 by 360 image inputs, here is the error message I am getting...

 File "my_test_blur_comp.py", line 209, in <module>
    main()
  File "my_test_blur_comp.py", line 148, in main
    output = util.single_forward(model, imgs_in)
  File "/content/EDVR-master/codes/utils/util.py", line 187, in single_forward
    model_output = model(inp)
  File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "/content/EDVR-master/codes/models/archs/EDVR_arch.py", line 259, in forward
    L1_fea = self.pre_deblur(x.view(-1, C, H, W))
  File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "/content/EDVR-master/codes/models/archs/EDVR_arch.py", line 52, in forward
    L2_fea = self.RB_L2_1(L2_fea) + L3_fea
RuntimeError: The size of tensor a (45) must match the size of tensor b (46) at non-singleton dimension 2

Note my modified test script is called, my_test_blur_comp.py

sjscotti commented 5 years ago

If it helps debugging the problem, if the input images are 640 by 720, there is no problem. If they are 1280 by 360, the same RuntimeError mentioned above occurs. So then I worked my way up from 640 by 360 to see if a small increase from 360 would work....

640 by 360 .... gives error 640 by 364 .... gives error 640 by 368 .... WORKS!

Can you suggest what the problem might be? Thanks!

xinntao commented 5 years ago

For the deblurring model, the height and weight of the input images should be a multiplication of 16. Because for the deblurring model,1) we first downsampled the input images by the scale factor of 4; 2) in the feature extraction, we use a pyramid structure. So the overall is 4x4=16.

sjscotti commented 5 years ago

That explains it! Thanks! I am satisfied if any others commenting on this issue want to close it out.