Skip to content

Learning Image-adaptive 3D Lookup Tables for High Performance Photo Enhancement in Real-time

Notifications You must be signed in to change notification settings

Zhou-Boxiang/Image-Adaptive-3DLUT

 
 

Repository files navigation

Image-Adaptive-3DLUT

Learning Image-adaptive 3D Lookup Tables for High Performance Photo Enhancement in Real-time

Downloads

Paper, Supplementary, Dataset, [PCT patent]

The whole datasets used in the paper are over 300G. Here I only provided the FiveK dataset resized into 480p resolution (including 8-bit sRGB, 16-bit XYZ inputs and 8-bit sRGB targets). I also provided 10 full-resolution images for testing speed. To obtain the entire full-resolution images, it is recommended to transform from the original FiveK dataset.

A model trained on the 480p resolution can be directly applied to images of 4K (or higher) resolution without performance drop. This can significantly speedup the training stage without loading the very heavy high-resolution images.

Abstract

Recent years have witnessed the increasing popularity of learning based methods to enhance the color and tone of photos. However, many existing photo enhancement methods either deliver unsatisfactory results or consume too much computational and memory resources, hindering their application to high-resolution images (usually with more than 12 megapixels) in practice. In this paper, we learn image-adaptive 3-dimensional lookup tables (3D LUTs) to achieve fast and robust photo enhancement. 3D LUTs are widely used for manipulating color and tone of photos, but they are usually manually tuned and fixed in camera imaging pipeline or photo editing tools. We, for the first time to our best knowledge, propose to learn 3D LUTs from annotated data using pairwise or unpaired learning. More importantly, our learned 3D LUT is image-adaptive for flexible photo enhancement. We learn multiple basis 3D LUTs and a small convolutional neural network (CNN) simultaneously in an end-to-end manner. The small CNN works on the down-sampled version of the input image to predict content-dependent weights to fuse the multiple basis 3D LUTs into an image-adaptive one, which is employed to transform the color and tone of source images efficiently. Our model contains less than 600K parameters and takes less than 2 ms to process an image of 4K resolution using one Titan RTX GPU. While being highly efficient, our model also outperforms the state-of-the-art photo enhancement methods by a large margin in terms of PSNR, SSIM and a color difference metric on two publically available benchmark datasets.

Framework

Usage

Requirements

Python3, requirements.txt

Build

By default, we use pytorch 0.4.1:

cd trilinear
sh make.sh

For pytorch 1.x:

The python wrapper in model.py needs to be modified, which will be supported in a few days.

Training

paired training

 python3 image_adaptive_lut_train_paired.py

unpaired training

still checking...

Evaluation

  1. use python to generate and save the test images:

    python3 image_adaptive_lut_evaluation.py
    

speed can also be tested in above code.

  1. use matlab to calculate the indexes used in our paper:

    average_psnr_ssim.m
    

Demo

python3 demo_eval.py

Citation

@article{zeng2020lut,
  title={Learning Image-adaptive 3D Lookup Tables for High Performance Photo Enhancement in Real-time},
  author={Zeng, Hui and Cai, Jianrui and Li, Lida and Cao, Zisheng and Zhang, Lei},
  journal={IEEE Transactions on Pattern Analysis and Machine Intelligence},
  volume={},
  number={},
  pages={},
  year={2020},
  publisher={IEEE}
}

About

Learning Image-adaptive 3D Lookup Tables for High Performance Photo Enhancement in Real-time

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 58.5%
  • Cuda 13.4%
  • MATLAB 9.7%
  • C 9.3%
  • C++ 8.5%
  • Objective-C 0.4%
  • Shell 0.2%