pesser / splatting

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fork of splatting with disabled JIT compilation and fix to build in conda environment. Original readme coming up.

splatting

This is a reimplementation of softmax-splatting, which can also be executed on CPU only devices.

test status

Coverage Status

setup

This implementation requires PyTorch to be installed. Once PyTorch is installed, the package can be compiled with pip install . or pip install -e ..

Alternatively, the extension can be compiled the first time you import it. Therefore ninja needs to be installed, for example with pip install ninja. Then just import the module in your python script. The first time you import it, the extension will be compiled. The second time, it does not need to compile it anymore.

usage

If you installed the extension with pip, you can simply import it:

from splatting import Splatting

If you choose to JIT compile it, you can add this repository to your project structure like

└── your_code
    ├── file1.py
    ├── file2.py
    └── utils
        └── splatting  // this repository

you can import like this:

from your_code.utils.splatting import Splatting

The splatting function can be used like this:

import torch
from splatting import Splatting, splatting_function

frame = torch.ones([1, 3, 4, 4])
flow = torch.ones([1, 2, 4, 4])

# use of the slatting function
output = splatting_function("average", frame, flow)

# use of the splatting module
output = Splatting("average")(frame, flow)

references

[1]  @inproceedings{Niklaus_CVPR_2020,
         author = {Simon Niklaus and Feng Liu},
         title = {Softmax Splatting for Video Frame Interpolation},
         booktitle = {IEEE International Conference on Computer Vision},
         year = {2020}
     }

About

License:MIT License


Languages

Language:Python 62.4%Language:C++ 19.4%Language:Cuda 18.3%