Hamada14 / Video-Enhancement

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Video-Enhancement

Directories Walkthrough

  • flownet2-pytorch

Pytorch implementation of FlowNet 2.0: Evolution of Optical Flow Estimation with Deep Networks.

  • pytorch-sepconv

Pytorch implementation of Video Frame Interpolation via Adaptive Separable Convolution

FlowNet2

Installation

  1. Download the FlowNet2 pretrained model to flownet2-pytorch/models

The available models are available below:

  1. Move the downloaded model to flownet2/models directory while keeping its name constant as FlowNet2_checkpoint.pth.tar.

  2. Run flownet2-pytorch/install.bash to compile the necessary libraries.

  3. Install the necessary libraries using pip:

$ pip3 install tensorboardX setproctitle colorama tqdm scipy pytz cvbase opencv-python

Demo

The below code can be used to run inference using a model that's stored locally and will produce a .flo file for each two consecutive pictures in the dataset folder.

There are two demo functions in flow_model_wrapper.py that can be used. Each of the functions demonstrates either calculating the flow for a specific directory or for a pair of images.

$ python3 flow_model_wrapper.py

Visualizing Optical Flow

  • To visualize a flow file:
# You might need to run `pip install cvbase` first
import cvbase as cvb
# to visualize a flow file
cvb.show_flow('result.flo')
  • To create a random flow and visualize it:
# run `pip install cvbase` first
import cvbase as cvb
# to visualize a loaded flow map
flow = np.random.rand(100, 100, 2).astype(np.float32)
cvb.show_flow(flow)

FRVSR

Trainer

In order for the trainer to work correctly a dataset must exist in a directory called data_set. The directory should contain any videos that should be used in the training process.

To start the training process, run the following command: python frvsr_trainer.py

About

License:GNU General Public License v3.0


Languages

Language:Python 93.0%Language:Cuda 3.4%Language:Roff 2.8%Language:C++ 0.7%Language:Shell 0.0%