baowenbo / DAIN

Depth-Aware Video Frame Interpolation (CVPR 2019)
https://sites.google.com/view/wenbobao/dain
MIT License
8.19k stars 840 forks source link

Fixing backward flow timestep bug in DAIN_slowmotion #91

Closed kmbriedis closed 1 year ago

kmbriedis commented 4 years ago

The calculation of timesteps for the backward flow computation in DAIN_slowmotion is incorrect if the timestep is not 1/N. Therefore the simple array reversal time_offsets[::-1] must be replaced by [1 - t for t in time_offsets]

Example: If timestep=0.15: time_offsets = [0.15, 0.3, 0.45, 0.6, 0.75] And currently calculated offsets from the second keyframe are [0.75, 0.6, 0.45, 0.3, 0.15] while they should be [0.85, 0.7, 0.55, 0.4, 0.25] and are all off by 0.1 which lead to a slightly unaligned warp for the second image and worse quality of the output.

VelocityRa commented 3 years ago

Is there a reason this hasn't been merged?

AlphaGit commented 3 years ago

I have incorporated these changes into my fork of this repository.