Skip to content

NonBee98/3DLUT-interpolation-Pytorch-extension

Repository files navigation

CPP/CUDA extension of 3DLUT Interpolation operators In Pytorch

Declaration

An example of 3Dlut operator extensin for Pytorch. This repository inherits some code from repository Image-Adaptive-3DLUT. The original repository contain some bugs, and they are fixed here.

Usage

Requirements

Python >= 3.8

Pytorch <= 1.11.0 (Don't use version >= 1.12, there are some incompatibility from the compiler. Ignore if you can solve this problem)

Build

Two interpolation operators implemented here - trilinear and tetrahedral interpolation. Compile them before using with:

cd trilinear_interp  
./setup.sh
cd ../tetrahedral_interp
./setup.sh

Run demo

test.py shows how to apply 3Dlut to the demo image with this implementation.

python3 test.py

test.ipynb jupyter notebook shows how to train a custom 3Dlut, you can use it to verify the correctness of the implementation interactively.

Notification

If you want to run cutsom extensions on multiple GPUs, please use Pytorch's DistributedDataParallel rather than simple DataParallel. The latter one seems have some bugs on cutsom extensions.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published