GithubHelp home page GithubHelp logo

babyblue26 / nilut Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mv-lab/nilut

0.0 0.0 0.0 20.01 MB

NILUT: Conditional Neural Implicit 3D Lookup Tables for Image Enhancement. https://twitter.com/_akhaliq/status/1678804195229433861?s=20

Home Page: https://arxiv.org/abs/2306.11920

License: MIT License

Python 0.11% Jupyter Notebook 99.89%

nilut's Introduction

arXiv colab demo Paper page Tweet

Marcos V. Conde, Javier Vazquez-Corral, Michael S. Brown, Radu Timofte

TL;DR NILUT uses neural representations for controllable photorealistic image enhancement. ๐Ÿš€ Demo Tutorial and pretrained models available. Try it on colab!

NILUT


3D lookup tables (3D LUTs) are a key component for image enhancement. Modern image signal processors (ISPs) have dedicated support for these as part of the camera rendering pipeline. Cameras typically provide multiple options for picture styles, where each style is usually obtained by applying a unique handcrafted 3D LUT.

In this work, we propose a Neural Implicit LUT (NILUT), an implicitly defined continuous 3D color transformation parameterized by a neural network. We show that NILUTs are capable of accurately emulating real 3D LUTs. Moreover, a NILUT can be extended to incorporate multiple styles into a single network with the ability to blend styles implicitly. Our novel approach is memory-efficient, controllable and can complement previous methods, including learned ISPs.

โœ๏ธ Topics Image Enhancement, Image Editing, Color Manipulation, Tone Mapping, Presets

โš ๏ธ Website and repo in progress. See also AISP for image signal processing code and papers.


Pre-trained models sample models are available at models/. We provide nilutx3style.pt a NILUT that encodes three 3D LUT styles (1,3,4) with high accuracy. Download the model here.

Demo Tutorial in nilut-multiblend.ipynb we provide a simple tutorial on how to use NILUT for multi-style image enhancement and blending. You can run it directly on colab in a few minutes. The corresponding training code will be released soon.

Simple Training check nilut.ipynb to see how to fit professional 3D LUT into a NILUT.

Dataset The complete folder dataset/ includes 100 images from the Adobe MIT 5K Dataset. The images were processed using professional 3D LUTs on Adobe Lightroom. For demo purposes, we include dataset in releases, you can download it here. The structure of the dataset is:

dataset/
โ”œโ”€โ”€ 001_blend.png
โ”œโ”€โ”€ 001_LUT01.png
โ”œโ”€โ”€ 001_LUT02.png
โ”œโ”€โ”€ 001_LUT03.png
โ”œโ”€โ”€ 001_LUT04.png
โ”œโ”€โ”€ 001_LUT05.png
โ”œโ”€โ”€ 001_LUT08.png
โ”œโ”€โ”€ 001_LUT10.png
โ””โ”€โ”€ 001.png
...

where 001.png is the input unprocessed image, 001_LUTXX.png is the result of applying each corresponding LUT and 001_blend.png is the example target for evaluating sytle-blending (in the example the blending is between styles 1,3, and 4 with equal weights 0.33). The complete dataset includes 100 images aaa.png and their enhanced variants for each 3D LUT.

How do we learn?

The complete E2E tutorial example on how to fit a NILUT is at nilut.ipynb

NILUT Fit

We use Hald images, a graphical representation of a 3D LUT in the form of a color table that contains all of the color gradations of the 3D LUT. Considering the input RGB space Hald, and the resultant one after applying a 3D LUT, we can use such pairs for training our models. You can read the details in our paper Section 4.

For example, we can represent the RGB color space (i.e. all the possible intensities) considering 256^3 = 16.78M points. This set of points can be represented as an image of dimension 4096ร—4096ร—3 (below, left). We can sample less points and build the hald image of the RGB space smaller --- see dataset/halds/Original_Image.png.

These images are available (together with the 3D LUT file) in our dataset.

Halt

You can read more about this here: https://3dlutcreator.com/3d-lut-creator---materials-and-luts.html

3D LUT video

Why is this interesting?

  • Depending on the complexity of the real 3D LUT and the NILUT architecture, we can perform the fitting in a few minutes! The model emulates with high-precision the behavious of real 3D LUTs.

  • NILUTs are by definition differentiable functions, you can plug&play with it, for example to enhance learned ISPs

  • NILUTS are very compact in comparison to complete 3D LUTs (even considering sampling and interpolation).

  • NILUTs are a novel application of implicit neural representations for color manipulation! In particular the multi-style encoding and implicit blending of styles.

Halt

Frequent questions

where is the full dataset?

We are working on hosting it, should be available by the end of July. If you need it asap please contact us. So far you can download a demo dataset to test out the model fitting and pre-trained models. The 3D LUTs are released under CC 4.0 license. The images are from Adobe MIT5K dataset and therefore keeps the original license.

how the style interpolation works?

First of all, is a cool feature, we are working on it, and more work in that direction is coming :) The implicit style blending is similar to the interpolation in other implicit neural representations (INRs) -- pixel interpolation in 2D INRs such as SIREN, novel view synthesis in 3D with NeRF. The more training points, the better the interpolation function is. In our example nilut-multiblend.ipynb we provide a CNILUT with encoded 3D LUT styles and trained on the blending basis [0.33, 0.33, 0.33] (i.e. equal contribution of each style). To achieve "any" blending, more training points are required to learn the manifold of styles, for example [0.5, 0.5, 0] [0.5, 0, 0.5] [0, 0.5, 0.5] etc. Training can take time, but once it is trained, a simple MLP encodes multiple 3D LUTs and can accurately blend them, moreover, since the model is constrained to pixel-wise transformations, no artifacts are introduced.


Hope you like it ๐Ÿค— If you find this interesting/insightful/inspirational or you use it, do not forget to acknowledge our work:

@article{conde2023nilut,
  title={NILUT: Conditional Neural Implicit 3D Lookup Tables for Image Enhancement},
  author={Conde, Marcos V and Vazquez-Corral, Javier and Brown, Michael S and Timofte, Radu},
  journal={arXiv preprint arXiv:2306.11920},
  year={2023}
}

Contact marcos.conde[at]uni-wuerzburg.de

nilut's People

Contributors

mv-lab avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.