Depth-Aware Video Frame Interpolation (CVPR 2019)

Related tags

Deep Learning DAIN
Overview

DAIN (Depth-Aware Video Frame Interpolation)

Project | Paper

Wenbo Bao, Wei-Sheng Lai, Chao Ma, Xiaoyun Zhang, Zhiyong Gao, and Ming-Hsuan Yang

IEEE Conference on Computer Vision and Pattern Recognition, Long Beach, CVPR 2019

This work is developed based on our TPAMI work MEMC-Net, where we propose the adaptive warping layer. Please also consider referring to it.

Table of Contents

  1. Introduction
  2. Citation
  3. Requirements and Dependencies
  4. Installation
  5. Testing Pre-trained Models
  6. Downloading Results
  7. Slow-motion Generation
  8. Training New Models
  9. Google Colab Demo

Introduction

We propose the Depth-Aware video frame INterpolation (DAIN) model to explicitly detect the occlusion by exploring the depth cue. We develop a depth-aware flow projection layer to synthesize intermediate flows that preferably sample closer objects than farther ones. Our method achieves state-of-the-art performance on the Middlebury dataset. We provide videos here.

Citation

If you find the code and datasets useful in your research, please cite:

@inproceedings{DAIN,
    author    = {Bao, Wenbo and Lai, Wei-Sheng and Ma, Chao and Zhang, Xiaoyun and Gao, Zhiyong and Yang, Ming-Hsuan}, 
    title     = {Depth-Aware Video Frame Interpolation}, 
    booktitle = {IEEE Conference on Computer Vision and Pattern Recognition},
    year      = {2019}
}
@article{MEMC-Net,
     title={MEMC-Net: Motion Estimation and Motion Compensation Driven Neural Network for Video Interpolation and Enhancement},
     author={Bao, Wenbo and Lai, Wei-Sheng, and Zhang, Xiaoyun and Gao, Zhiyong and Yang, Ming-Hsuan},
     journal={IEEE Transactions on Pattern Analysis and Machine Intelligence},
     doi={10.1109/TPAMI.2019.2941941},
     year={2018}
}

Requirements and Dependencies

  • Ubuntu (We test with Ubuntu = 16.04.5 LTS)
  • Python (We test with Python = 3.6.8 in Anaconda3 = 4.1.1)
  • Cuda & Cudnn (We test with Cuda = 9.0 and Cudnn = 7.0)
  • PyTorch (The customized depth-aware flow projection and other layers require ATen API in PyTorch = 1.0.0)
  • GCC (Compiling PyTorch 1.0.0 extension files (.c/.cu) requires gcc = 4.9.1 and nvcc = 9.0 compilers)
  • NVIDIA GPU (We use Titan X (Pascal) with compute = 6.1, but we support compute_50/52/60/61 devices, should you have devices with higher compute capability, please revise this)

Installation

Download repository:

$ git clone https://github.com/baowenbo/DAIN.git

Before building Pytorch extensions, be sure you have pytorch >= 1.0.0:

$ python -c "import torch; print(torch.__version__)"

Generate our PyTorch extensions:

$ cd DAIN
$ cd my_package 
$ ./build.sh

Generate the Correlation package required by PWCNet:

$ cd ../PWCNet/correlation_package_pytorch1_0
$ ./build.sh

Testing Pre-trained Models

Make model weights dir and Middlebury dataset dir:

$ cd DAIN
$ mkdir model_weights
$ mkdir MiddleBurySet

Download pretrained models,

$ cd model_weights
$ wget http://vllab1.ucmerced.edu/~wenbobao/DAIN/best.pth

and Middlebury dataset:

$ cd ../MiddleBurySet
$ wget http://vision.middlebury.edu/flow/data/comp/zip/other-color-allframes.zip
$ unzip other-color-allframes.zip
$ wget http://vision.middlebury.edu/flow/data/comp/zip/other-gt-interp.zip
$ unzip other-gt-interp.zip
$ cd ..

preinstallations:

$ cd PWCNet/correlation_package_pytorch1_0
$ sh build.sh
$ cd ../my_package
$ sh build.sh
$ cd ..

We are good to go by:

$ CUDA_VISIBLE_DEVICES=0 python demo_MiddleBury.py

The interpolated results are under MiddleBurySet/other-result-author/[random number]/, where the random number is used to distinguish different runnings.

Downloading Results

Our DAIN model achieves the state-of-the-art performance on the UCF101, Vimeo90K, and Middlebury (eval and other). Download our interpolated results with:

$ wget http://vllab1.ucmerced.edu/~wenbobao/DAIN/UCF101_DAIN.zip
$ wget http://vllab1.ucmerced.edu/~wenbobao/DAIN/Vimeo90K_interp_DAIN.zip
$ wget http://vllab1.ucmerced.edu/~wenbobao/DAIN/Middlebury_eval_DAIN.zip
$ wget http://vllab1.ucmerced.edu/~wenbobao/DAIN/Middlebury_other_DAIN.zip

Slow-motion Generation

Our model is fully capable of generating slow-motion effect with minor modification on the network architecture. Run the following code by specifying time_step = 0.25 to generate x4 slow-motion effect:

$ CUDA_VISIBLE_DEVICES=0 python demo_MiddleBury_slowmotion.py --netName DAIN_slowmotion --time_step 0.25

or set time_step to 0.125 or 0.1 as follows

$ CUDA_VISIBLE_DEVICES=0 python demo_MiddleBury_slowmotion.py --netName DAIN_slowmotion --time_step 0.125
$ CUDA_VISIBLE_DEVICES=0 python demo_MiddleBury_slowmotion.py --netName DAIN_slowmotion --time_step 0.1

to generate x8 and x10 slow-motion respectively. Or if you would like to have x100 slow-motion for a little fun.

$ CUDA_VISIBLE_DEVICES=0 python demo_MiddleBury_slowmotion.py --netName DAIN_slowmotion --time_step 0.01

You may also want to create gif animations by:

$ cd MiddleBurySet/other-result-author/[random number]/Beanbags
$ convert -delay 1 *.png -loop 0 Beanbags.gif //1*10ms delay 

Have fun and enjoy yourself!

Training New Models

Download the Vimeo90K triplet dataset for video frame interpolation task, also see here by Xue et al., IJCV19.

$ cd DAIN
$ mkdir /path/to/your/dataset & cd /path/to/your/dataset 
$ wget http://data.csail.mit.edu/tofu/dataset/vimeo_triplet.zip
$ unzip vimeo_triplet.zip
$ rm vimeo_triplet.zip

Download the pretrained MegaDepth and PWCNet models

$ cd MegaDepth/checkpoints/test_local
$ wget http://vllab1.ucmerced.edu/~wenbobao/DAIN/best_generalization_net_G.pth
$ cd ../../../PWCNet
$ wget http://vllab1.ucmerced.edu/~wenbobao/DAIN/pwc_net.pth.tar
$ cd  ..

Run the training script:

$ CUDA_VISIBLE_DEVICES=0 python train.py --datasetPath /path/to/your/dataset --batch_size 1 --save_which 1 --lr 0.0005 --rectify_lr 0.0005 --flow_lr_coe 0.01 --occ_lr_coe 0.0 --filter_lr_coe 1.0 --ctx_lr_coe 1.0 --alpha 0.0 1.0 --patience 4 --factor 0.2

The optimized models will be saved to the model_weights/[random number] directory, where [random number] is generated for different runs.

Replace the pre-trained model_weights/best.pth model with the newly trained model_weights/[random number]/best.pth model. Then test the new model by executing:

$ CUDA_VISIBLE_DEVICES=0 python demo_MiddleBury.py

Google Colab Demo

This is a modification of DAIN that allows the usage of Google Colab and is able to do a full demo interpolation from a source video to a target video.

Original Notebook File by btahir can be found here.

To use the Colab, follow these steps:

  • Download the Colab_DAIN.ipynb file (link).
  • Visit Google Colaboratory (link)
  • Select the "Upload" option, and upload the .ipynb file
  • Start running the cells one by one, following the instructions.

Colab file authors: Styler00Dollar and Alpha.

Contact

Wenbo Bao; Wei-Sheng (Jason) Lai

License

See MIT License

Comments
  • Google Colab CUDA error

    Google Colab CUDA error

    Tried to get this running on Colab, but I'm running into cuda issues... Link to notebook.

    Any ideas on how to fix this? Would be great to just have a Colab to experiment!

    error in correlation_forward_cuda_kernel: no kernel image is available for execution on the device Warning: Legacy autograd function with non-static forward method is deprecated and will be removed in 1.3. Please use new-style autograd function with static forward method. (Example: https://pytorch.org/docs/stable/autograd.html#torch.autograd.Function) (THPFunction_do_forward at /pytorch/torch/csrc/autograd/python_function.cpp:622)

    Traceback (most recent call last): File "demo_MiddleBury.py", line 131, in y_s,offset,filter = model(torch.stack((X0, X1),dim = 0)) File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 532, in call result = self.forward(*input, **kwargs) File "/content/DAIN/networks/DAIN.py", line 149, in forward self.forward_flownets(self.flownets, cur_offset_input, time_offsets=time_offsets), File "/content/DAIN/networks/DAIN.py", line 205, in forward_flownets temp = model(input) # this is a single direction motion results, but not a bidirectional one File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 532, in call result = self.forward(*input, **kwargs) File "/content/DAIN/PWCNet/PWCNet.py", line 220, in forward corr6 = self.corr(c16, c26) File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 532, in call result = self.forward(*input, **kwargs) File "/content/DAIN/PWCNet/correlation_package_pytorch1_0/correlation.py", line 59, in forward result = CorrelationFunction(self.pad_size, self.kernel_size, self.max_displacement,self.stride1, self.stride2, self.corr_multiply)(input1, input2) File "/content/DAIN/PWCNet/correlation_package_pytorch1_0/correlation.py", line 27, in forward self.pad_size, self.kernel_size, self.max_displacement,self.stride1, self.stride2, self.corr_multiply)

    RuntimeError: CUDA call failed (correlation_forward_cuda at correlation_cuda.cc:80) frame #0: c10::Error::Error(c10::SourceLocation, std::string const&) + 0x33 (0x7fe6bc85e193 in /usr/local/lib/python3.6/dist-packages/torch/lib/libc10.so) frame #1: correlation_forward_cuda(at::Tensor&, at::Tensor&, at::Tensor&, at::Tensor&, at::Tensor&, int, int, int, int, int, int) + 0x628 (0x7fe6b8f59ad8 in /usr/local/lib/python3.6/dist-packages/correlation_cuda-0.0.0-py3.6-linux-x86_64.egg/correlation_cuda.cpython-36m-x86_64-linux-gnu.so) frame #2: + 0x1bd3a (0x7fe6b8f69d3a in /usr/local/lib/python3.6/dist-packages/correlation_cuda-0.0.0-py3.6-linux-x86_64.egg/correlation_cuda.cpython-36m-x86_64-linux-gnu.so) frame #3: + 0x18880 (0x7fe6b8f66880 in /usr/local/lib/python3.6/dist-packages/correlation_cuda-0.0.0-py3.6-linux-x86_64.egg/correlation_cuda.cpython-36m-x86_64-linux-gnu.so) frame #4: python3() [0x50ac25]

    opened by aiXander 49
  • Fixed colab dependency versions

    Fixed colab dependency versions

    Fixes #44.

    Detailed changes

    • Minor updates on instructions to run the colab file
    • Made the colab file install torch 1.4.0+cu100, torchvision 0.5.0+cu100 and scipy 1.1.0 (thanks @CyFeng16)
    • Made the colab file clone the code from the official repo (this can now be done since the main changes are merged in it)
    • Removed warning messages when running interpolation (thanks @CyFeng16)
    opened by AlphaGit 14
  • How to prevent out of memories errors

    How to prevent out of memories errors

    Hey there I'm currently trying to run a 1080p video through dain, well as you probably guess it kills the vram, so I could I somehow circumvent this issue ? (And hopefully not lose quality)

    If read that you could downscale it (and run different parts of it) but wouldn't that lower the quality of the end result? Also how would I even do that if it's possible?

    opened by eDexiam 12
  • Does not install on Ubuntu 20.04

    Does not install on Ubuntu 20.04

    Following the installation instructions I ran out into an error that there must be a Conda environment called pytorch1.0.0 after running ./build.sh – this is not mentioned in the compilation instructions. Well, I created a Conda environment called pytorch1.0.0 and installed pytorch v1.4.0 (I saw on issue #118 that newer versions of pytorch aren't compatible, this is also not on the instructions) and ran build.sh again. Now, I come to:

    (pytorch1.0.0) luiz@luiz-Aspire-V3-772:[/media/luiz/Volume/Downloads/DAIN/my_package]: ./build.sh
    Need pytorch>=1.0.0
    ./build.sh: line 4: activate: No such file or directory
    Traceback (most recent call last):
      File "setup.py", line 16, in <module>
        ], extra_compile_args={'cxx': cxx_args, 'nvcc': nvcc_args})
      File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 498, in CUDAExtension
        library_dirs += library_paths(cuda=True)
      File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 577, in library_paths
        if (not os.path.exists(_join_cuda_home(lib_dir)) and
      File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1252, in _join_cuda_home
        raise EnvironmentError('CUDA_HOME environment variable is not set. '
    OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.
    Traceback (most recent call last):
      File "setup.py", line 16, in <module>
        ], extra_compile_args={'cxx': cxx_args, 'nvcc': nvcc_args})
      File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 498, in CUDAExtension
        library_dirs += library_paths(cuda=True)
      File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 577, in library_paths
        if (not os.path.exists(_join_cuda_home(lib_dir)) and
      File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1252, in _join_cuda_home
        raise EnvironmentError('CUDA_HOME environment variable is not set. '
    OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.
    Traceback (most recent call last):
      File "setup.py", line 16, in <module>
        ], extra_compile_args={'cxx': cxx_args, 'nvcc': nvcc_args})
      File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 498, in CUDAExtension
        library_dirs += library_paths(cuda=True)
      File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 577, in library_paths
        if (not os.path.exists(_join_cuda_home(lib_dir)) and
      File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1252, in _join_cuda_home
        raise EnvironmentError('CUDA_HOME environment variable is not set. '
    OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.
    Traceback (most recent call last):
      File "setup.py", line 16, in <module>
        ], extra_compile_args={'cxx': cxx_args, 'nvcc': nvcc_args})
      File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 498, in CUDAExtension
        library_dirs += library_paths(cuda=True)
      File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 577, in library_paths
        if (not os.path.exists(_join_cuda_home(lib_dir)) and
      File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1252, in _join_cuda_home
        raise EnvironmentError('CUDA_HOME environment variable is not set. '
    OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.
    Traceback (most recent call last):
      File "setup.py", line 16, in <module>
        ], extra_compile_args={'cxx': cxx_args, 'nvcc': nvcc_args})
      File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 498, in CUDAExtension
        library_dirs += library_paths(cuda=True)
      File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 577, in library_paths
        if (not os.path.exists(_join_cuda_home(lib_dir)) and
      File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1252, in _join_cuda_home
        raise EnvironmentError('CUDA_HOME environment variable is not set. '
    OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.
    Traceback (most recent call last):
      File "setup.py", line 16, in <module>
        ], extra_compile_args={'cxx': cxx_args, 'nvcc': nvcc_args})
      File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 498, in CUDAExtension
        library_dirs += library_paths(cuda=True)
      File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 577, in library_paths
        if (not os.path.exists(_join_cuda_home(lib_dir)) and
      File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1252, in _join_cuda_home
        raise EnvironmentError('CUDA_HOME environment variable is not set. '
    OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.
    Traceback (most recent call last):
      File "setup.py", line 16, in <module>
        ], extra_compile_args={'cxx': cxx_args, 'nvcc': nvcc_args})
      File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 498, in CUDAExtension
        library_dirs += library_paths(cuda=True)
      File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 577, in library_paths
        if (not os.path.exists(_join_cuda_home(lib_dir)) and
      File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1252, in _join_cuda_home
        raise EnvironmentError('CUDA_HOME environment variable is not set. '
    OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.
    Traceback (most recent call last):
      File "setup.py", line 16, in <module>
        ], extra_compile_args={'cxx': cxx_args, 'nvcc': nvcc_args})
      File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 498, in CUDAExtension
        library_dirs += library_paths(cuda=True)
      File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 577, in library_paths
        if (not os.path.exists(_join_cuda_home(lib_dir)) and
      File "/media/luiz/Volume/anaconda3/envs/pytorch1.0.0/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1252, in _join_cuda_home
        raise EnvironmentError('CUDA_HOME environment variable is not set. '
    OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.
    
    opened by lgmventura 8
  • ModuleNotFoundError: No module named 'filterinterpolation_cuda'

    ModuleNotFoundError: No module named 'filterinterpolation_cuda'

    Hi Bao,

    Executed this command: CUDA_VISIBLE_DEVICES=0 python demo_MiddleBury.py and getting this module not found error, it is present though. I have covered all as mentioned and got stuck in this step.

    Need help, Thanks!!

    opened by dilipv09 6
  • Interpolate entire sequence

    Interpolate entire sequence

    when I try to interpolate a sequence (1 minute of video) it only interpolates the first frame and nothing else. example: if the interpolation is at 0.25 it only interpolates the first 4 frames and the process stops.

    what's the problem in this?

    opened by Jerchongkong 6
  • Kernel Panic using Cuda 10.2

    Kernel Panic using Cuda 10.2

    Hello - firstly, thanks for this and your great documentation. Much appreciated.

    Im using Ubuntu 18.0.4 LTS, Cuda 10.2, Nvidia 4.40 drivers and a single Titan X

    Ive followed the readme, installed the dependencies in a virtual envs, compiled the extensions, and am able to run the demo - however, after a few seconds the demo crashes and kernal panics the entire system.

    I've attempted to edit both extension 's NVCC flags, as per the helpful note in the documentation, but to no avail.

        '-gencode', 'arch=compute_52,code=sm_52',
        '-gencode', 'arch=compute_60,code=sm_60',
        '-gencode', 'arch=compute_61,code=sm_61',
        '-gencode', 'arch=compute_70,code=sm_70',
        '-gencode', 'arch=compute_75,code=sm_75',
        '-gencode', 'arch=compute_75,code=compute_75',
    

    However, that also kernel panics the machine.

    I am able to monitor GPU memory usage right before the crash and am able to see pytorch allocating GPU memory, but It appears to go to the max, then the system dies.

    Are there other specific hardware requirements for this code base?

    opened by vade 5
  • Scipy no longer supports imread/imwrite, need to use imageio

    Scipy no longer supports imread/imwrite, need to use imageio

    Using newer SciPy (which is an unlisted requirement btw), needs changes to some code to not use scipy.misc.imread etc, and rather use http://imageio.github.io

    opened by vade 5
  • When I run the 2nd command from the Readme, I get the error „No module named torch”

    When I run the 2nd command from the Readme, I get the error „No module named torch”

    When I run the 2nd command from the Readme, the command being

    python -c "import torch; print(torch.__version__)"

    , I get this error as the output of the command:

    Traceback (most recent call last): File "", line 1, in ImportError: No module named torch

    . How do I fix this error so that I can install DAIN on my Linux Computer?

    opened by Sosasees 4
  • Colab compatibility improvements

    Colab compatibility improvements

    Hi! I just added these fixes that improve on the Colab compatibility experience.

    • Ensure Google Colab GPU Compatibility
      • Added parameters to compile for all available GPU models in Google Colaboratory.
      • Moved the instructions to a common file used by all setup files
      • Adapted Colab file, removing outdated error indicators
    • Suppressing compiler warnings
    • Updated documentation
      • Updated documentation inside and outside of Colab file.
      • Removed references to any shared Colab file, to avoid outdated versions out there. The one in the master branch of this repo should be the canonical one.
      • Added versioning to the file itself, so we can easily tell when someone is using an old version of the file.
      • Added markdown input for configuration
    opened by AlphaGit 4
  • Import Error when importing correlation_cuda

    Import Error when importing correlation_cuda

    I get the following Error when importing correlation_cuda in python 3.6 and python 2.7 with torch 1.4.0 and 1.1.0:

    /usr/local/lib/python3.6/dist-packages/correlation_cuda-0.0.0-py3.6-linux-x86_64.egg/correlation_cuda.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZN3c105ErrorC1ENS_14SourceLocationERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE

    the other modules from the my_package directories work fine.

    opened by StefanBaar 4
  • CalledProcessError - DAIN Google Colab

    CalledProcessError - DAIN Google Colab

    Hello, how are you, I get this error, I don't know how to solve it, what am I doing wrong?

    Create output video

    %cd {FRAME_OUTPUT_DIR} %shell ffmpeg -y -r {60} -f image2 -pattern_type glob -i '*.png' '/content/gdrive/My Drive/{OUTPUT_FILE_PATH}'

    /content/DAIN/output_frames ffmpeg version 3.4.11-0ubuntu0.1 Copyright (c) 2000-2022 the FFmpeg developers built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04) configuration: --prefix=/usr --extra-version=0ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared libavutil 55. 78.100 / 55. 78.100 libavcodec 57.107.100 / 57.107.100 libavformat 57. 83.100 / 57. 83.100 libavdevice 57. 10.100 / 57. 10.100 libavfilter 6.107.100 / 6.107.100 libavresample 3. 7. 0 / 3. 7. 0 libswscale 4. 8.100 / 4. 8.100 libswresample 2. 9.100 / 2. 9.100 libpostproc 54. 7.100 / 54. 7.100 [image2 @ 0x55c2d93c8000] Could not open file : .png [image2 @ 0x55c2d93c8000] Could not find codec parameters for stream 0 (Video: png, none(pc)): unspecified size Consider increasing the value for the 'analyzeduration' and 'probesize' options Input #0, image2, from '.png': Duration: 00:00:00.02, start: 0.000000, bitrate: N/A Stream #0:0: Video: png, none(pc), 60 tbr, 60 tbn, 60 tbc Output #0, mp4, to '/content/gdrive/My Drive/DAIN/output.mp4': Output file #0 does not contain any stream

    CalledProcessError Traceback (most recent call last) in 1 # Create output video 2 get_ipython().run_line_magic('cd', '{FRAME_OUTPUT_DIR}') ----> 3 get_ipython().run_line_magic('shell', "ffmpeg -y -r {60} -f image2 -pattern_type glob -i '*.png' '/content/gdrive/My Drive/{OUTPUT_FILE_PATH}'")

    2 frames /usr/local/lib/python3.7/dist-packages/google/colab/_system_commands.py in check_returncode(self) 133 if self.returncode: 134 raise subprocess.CalledProcessError( --> 135 returncode=self.returncode, cmd=self.args, output=self.output) 136 137 def repr_pretty(self, p, cycle): # pylint:disable=unused-argument

    CalledProcessError: Command 'ffmpeg -y -r 60 -f image2 -pattern_type glob -i '*.png' '/content/gdrive/My Drive/DAIN/output.mp4'' returned non-zero exit status 1.

    opened by heraldob 2
  • Images in README.md aren't showing.

    Images in README.md aren't showing. "Content length exceeded" error

    Just letting you know that the images on your README.md file are not working. Requests to the images are currently returning a "Content length exceeded" error message.

    opened by JeffJacobson 0
  • OSError: unknown file format

    OSError: unknown file format

    got this

    /content/DAIN revise the unique id to a random numer 67519 Namespace(SAVED_MODEL=None, alpha=[0.0, 1.0], arg='./model_weights/67519-Sun-Jan-23-12-26/args.txt', batch_size=1, channels=3, ctx_lr_coe=1.0, datasetName='Vimeo_90K_interp', datasetPath='', dataset_split=97, debug=False, depth_lr_coe=0.001, doubleframe_distorted_pixel_ratio=0.002, doubleframe_distortion_threshold=20, dtype=<class 'torch.cuda.FloatTensor'>, end_frame=36, epsilon=1e-06, factor=0.2, filter_lr_coe=1.0, filter_size=4, flow_lr_coe=0.01, force=False, frame_input_dir='/content/DAIN/input_frames', frame_output_dir='/content/DAIN/output_frames', log='./model_weights/67519-Sun-Jan-23-12-26/log.txt', lr=0.002, mixer='normal', netName='DAIN_slowmotion', no_date=False, numEpoch=100, occ_lr_coe=1.0, patience=5, rectify_lr=0.001, resize_hotfix=False, save_path='./model_weights/67519-Sun-Jan-23-12-26', save_which=1, seed=1, start_frame=1, time_step=0.11988011988011989, uid=None, use_cuda=True, use_cudnn=1, weight_decay=0, workers=8) cudnn is used Interpolate 7 frames Traceback (most recent call last): File "colab_interpolate.py", line 64, in big_font = ImageFont.truetype(urlopen(font_url), size=24) File "/usr/local/lib/python3.7/dist-packages/PIL/ImageFont.py", line 648, in truetype return freetype(font) File "/usr/local/lib/python3.7/dist-packages/PIL/ImageFont.py", line 645, in freetype return FreeTypeFont(font, size, index, encoding, layout_engine) File "/usr/local/lib/python3.7/dist-packages/PIL/ImageFont.py", line 197, in init load_from_bytes(font) File "/usr/local/lib/python3.7/dist-packages/PIL/ImageFont.py", line 179, in load_from_bytes "", size, index, encoding, self.font_bytes, layout_engine OSError: unknown file format

    on !python -W ignore colab_interpolate.py --netName DAIN_slowmotion --time_step {fps/TARGET_FPS} --start_frame 1 --end_frame {pngs_generated_count} --frame_input_dir '{FRAME_INPUT_DIR}' --frame_output_dir '{FRAME_OUTPUT_DIR}'

    opened by kilik128 10
  • Not able to build the project while using cuda-10.1. Getting some errors.

    Not able to build the project while using cuda-10.1. Getting some errors.

    So I have cuda-10.1 installed. I followed the steps given in the repository but when I run ./build.sh inside my_package directory, I got the error saying command 'gcc' failed with exit status 1.(screenshots attached). GCC version that is installed in my conda environment is 11.2.0. As mentioned in the errors of screenshot, there was no folder named crt but there were host_defines.h files in include directory of cuda-10.1 . So I tried to create a folder named crt inside include directory of cuda-10.1 and copied the host_defines.h files there but after that too there were some lengthy errors coming initial of which I have attached(error2).

    I request people and the authors to help me rectify this issue. What can be the reason for these issues to come up? Is it due to the usage of cuda-10.1 ?

    GCC_FailedError

    Error2

    opened by Rishabh-Samra 2
  • The results are shaking

    The results are shaking

    Hi author, thanks for your impressive work! I have a question about my own video. After interpolating and gathering all frames into a video, I find that the video shakes severely. Specifically, it seems like the interpolated frames are cropped using a larger box from the padded output and then scaled down to align the resolution. Besides, if I use some videos with high FPS, the shaking is lighter.

    opened by yfji 0
This is the official repository of XVFI (eXtreme Video Frame Interpolation)

XVFI This is the official repository of XVFI (eXtreme Video Frame Interpolation), https://arxiv.org/abs/2103.16206 Last Update: 20210607 We provide th

Jihyong Oh 195 Dec 29, 2022
Repository relating to the CVPR21 paper TimeLens: Event-based Video Frame Interpolation

TimeLens: Event-based Video Frame Interpolation This repository is about the High Speed Event and RGB (HS-ERGB) dataset, used in the 2021 CVPR paper T

Robotics and Perception Group 544 Dec 19, 2022
RIFE: Real-Time Intermediate Flow Estimation for Video Frame Interpolation

RIFE RIFE: Real-Time Intermediate Flow Estimation for Video Frame Interpolation Ported from https://github.com/hzwer/arXiv2020-RIFE Dependencies NumPy

null 49 Jan 7, 2023
Asymmetric Bilateral Motion Estimation for Video Frame Interpolation, ICCV2021

ABME (ICCV2021) Junheum Park, Chul Lee, and Chang-Su Kim Official PyTorch Code for "Asymmetric Bilateral Motion Estimation for Video Frame Interpolati

Junheum Park 86 Dec 28, 2022
an implementation of Revisiting Adaptive Convolutions for Video Frame Interpolation using PyTorch

revisiting-sepconv This is a reference implementation of Revisiting Adaptive Convolutions for Video Frame Interpolation [1] using PyTorch. Given two f

Simon Niklaus 59 Dec 22, 2022
RIFE: Real-Time Intermediate Flow Estimation for Video Frame Interpolation

RIFE - Real Time Video Interpolation arXiv | YouTube | Colab | Tutorial | Demo Table of Contents Introduction Collection Usage Evaluation Training and

hzwer 3k Jan 4, 2023
An implementation of Video Frame Interpolation via Adaptive Separable Convolution using PyTorch

This work has now been superseded by: https://github.com/sniklaus/revisiting-sepconv sepconv-slomo This is a reference implementation of Video Frame I

Simon Niklaus 984 Dec 16, 2022
RIFE - Real-Time Intermediate Flow Estimation for Video Frame Interpolation

RIFE - Real-Time Intermediate Flow Estimation for Video Frame Interpolation YouTube | BiliBili 16X interpolation results from two input images: Introd

旷视天元 MegEngine 28 Dec 9, 2022
Video Frame Interpolation with Transformer (CVPR2022)

VFIformer Official PyTorch implementation of our CVPR2022 paper Video Frame Interpolation with Transformer Dependencies python >= 3.8 pytorch >= 1.8.0

DV Lab 63 Dec 16, 2022
SE3 Pose Interp - Interpolate camera pose or trajectory in SE3, pose interpolation, trajectory interpolation

SE3 Pose Interpolation Pose estimated from SLAM system are always discrete, and

Ran Cheng 4 Dec 15, 2022
Beyond Image to Depth: Improving Depth Prediction using Echoes (CVPR 2021)

Beyond Image to Depth: Improving Depth Prediction using Echoes (CVPR 2021) Kranti Kumar Parida, Siddharth Srivastava, Gaurav Sharma. We address the pr

Kranti Kumar Parida 33 Jun 27, 2022
(CVPR 2022 - oral) Multi-View Depth Estimation by Fusing Single-View Depth Probability with Multi-View Geometry

Multi-View Depth Estimation by Fusing Single-View Depth Probability with Multi-View Geometry Official implementation of the paper Multi-View Depth Est

Bae, Gwangbin 138 Dec 28, 2022
The implemention of Video Depth Estimation by Fusing Flow-to-Depth Proposals

Flow-to-depth (FDNet) video-depth-estimation This is the implementation of paper Video Depth Estimation by Fusing Flow-to-Depth Proposals Jiaxin Xie,

null 32 Jun 14, 2022
[CVPR'21] Learning to Recommend Frame for Interactive Video Object Segmentation in the Wild

IVOS-W Paper Learning to Recommend Frame for Interactive Video Object Segmentation in the Wild Zhaoyun Yin, Jia Zheng, Weixin Luo, Shenhan Qian, Hanli

SVIP Lab 38 Dec 12, 2022
An official implementation of "SFNet: Learning Object-aware Semantic Correspondence" (CVPR 2019, TPAMI 2020) in PyTorch.

PyTorch implementation of SFNet This is the implementation of the paper "SFNet: Learning Object-aware Semantic Correspondence". For more information,

CV Lab @ Yonsei University 87 Dec 30, 2022
Official code for CVPR2022 paper: Depth-Aware Generative Adversarial Network for Talking Head Video Generation

?? Depth-Aware Generative Adversarial Network for Talking Head Video Generation (CVPR 2022) ?? If DaGAN is helpful in your photos/projects, please hel

Fa-Ting Hong 503 Jan 4, 2023
The source code of CVPR 2019 paper "Deep Exemplar-based Video Colorization".

Deep Exemplar-based Video Colorization (Pytorch Implementation) Paper | Pretrained Model | Youtube video ?? | Colab demo Deep Exemplar-based Video Col

Bo Zhang 253 Dec 27, 2022
Monocular Depth Estimation - Weighted-average prediction from multiple pre-trained depth estimation models

merged_depth runs (1) AdaBins, (2) DiverseDepth, (3) MiDaS, (4) SGDepth, and (5) Monodepth2, and calculates a weighted-average per-pixel absolute dept

Pranav 39 Nov 21, 2022
Monocular Depth Estimation Using Laplacian Pyramid-Based Depth Residuals

LapDepth-release This repository is a Pytorch implementation of the paper "Monocular Depth Estimation Using Laplacian Pyramid-Based Depth Residuals" M

Minsoo Song 205 Dec 30, 2022