README.md

September 22, 2022 · View on GitHub

Data Preparation

PPR10K Dateset:

Download raw portrait photos and retouching target from baiduyun (code:pprd).

MIT-Adobe FiveK Dataset:

Download raw portrait photos and retouching target from baiduyun (code:fv5k).

HDR+ Dateset:

Download raw portrait photos and retouching target from baiduyun (code:hdrp).

Please ensure the data structure is as below

├── ppr
   ├── train
       ├── source_aug
           ├── 0_0.tif
           ├── 0_0_1.tif
           └── ...
       ├── target
           ├── 0_0.tif
           ├── 0_1.tif
           └── ...
   └── val
       ├── source
           ├── 1356_0.tif
           ├── 1356_1.tif
           └── ...
       ├── target
           ├── 1356_0.tif
           ├── 1356_1.tif
           └── ...
           
├── FiveK
   ├── train_input
           ├── 1_0.tif
           └── ...
   ├── train_target
           ├── 1_0.tif
           └── ...
   ├── test_input
           ├── 4501_0.tif
           └── ...
   ├── test_target
           ├── 4501_0.tif
           └── ...
           
└── hdr
   ├── train_input
           ├── 193_0.tif
           └── ...
   ├── train_target
           ├── 193_0.tif
           └── ...
   ├── test_input
           ├── 196_0.tif
           └── ...
   ├── test_target
           ├── 196_0.tif
           └── ...

##Environment Preparation Requirements

pip install -r requirements.txt

Build. Modify the CUDA path in trilinear_cpp/setup.sh adaptively and

cd trilinear_cpp
sh trilinear_cpp/setup.sh

Training

To train our method on the dataset, please run this command:

python train_lut_bilinear_pooling_effres.py --data_path [path_to_dataset] --gpu_id [gpu_id] --output_dir [path_to_save_models]

Evaluation

To evaluate our model on the dataset, run:

Generate the retouched results:

python validation.py --data_path [path_to_dataset] --gpu_id [gpu_id] --model_dir [path_to_models]

Use matlab to calculate the measures in our paper, Please input the address of the photos generated by the model, the address of the expert retouched target photos and the address of the portrait area mask respectively.

source_dir='';
target_dir='';
mask_dir='';

Pre-trained Models

You can download pretrained models from baiduyun (code:pprm).


├── saved_models
   ├── fivek
       ├── classifier_0.pth
       └── LUTs_0.pth
   ├── hdr
        ...
   ├── ppr
       └── ...

Results

Our model achieves the following performance on PPR10K dataset:

DatasetPSNR△E-abPSNR-HC
PPR-a26.516.4529.74
PPR-b25.407.4228.66
PPR-c25.897.2129.15
PPR-HR26.216.6229.44

Our model achieves the following performance on FiveK dataset:

DatasetPSNR△E-abSSIM
FiveK25.427.290.917

Our model achieves the following performance on HDR+ dataset:

DatasetPSNR△E-abSSIM
HDR+23.777.890.866