Home

Awesome

Rendered_Image_Harmonization_Dataset

This is the official repository for the following paper:

Deep Image Harmonization by Bridging the Reality Gap [arXiv]<br>

Junyan Cao, Wenyan Cong, Li Niu, Jianfu Zhang, Liqing Zhang <br> Accepted by BMVC 2022.

RdHarmony is a large-scale Rendered Image Harmonization dataset containing pairs of ground-truth rendered images and composite rendered images with 11 novel categories, which is useful for supervised image harmonization methods. Note that in our paper, RdHarmony contains rendered training pairs with 6 novel categories. We extend it to 5 more novel categories now.

<img src='examples/dataset_triplet.png' align="center" width=1024>

Highlights

Downloads

For "human" novel category:

For other 10 novel categories ("bottle", "cake", "motorcycle", "cow", "couch", "apple", "car", "chair", "dog" and "knife"):

Details

<img src='examples/groundtruth_example.jpg' align="center" width=1024> <img src='examples/dataset_examples_r5_1.png' align="center" width=1024> <img src='examples/dataset_examples_r5_2.png' align="center" width=1024>

Our CharmNet

Here we provide PyTorch implementation of our CharmNet.

Prerequisites

Getting Started

git clone https://github.com/bcmi/Rendered-Image-Harmonization-Dataset-RdHarmony.git
cd CharmNet

For pip users, please type the command pip install -r requirements.txt

Please specify dataset_root and name in the corresponding place.

python train.py --dataset_root <path_to_datasets> --name <experiment_name> --model dastyle --is_train 1 --norm batch --preprocess resize_and_crop --batch_size 8 --lr_policy step --lr_decay_iters 4702400

lr_decay_iters is equal to the number of training images in real domain.

python test.py --dataset_root <path_to_iHarmony4_dataset> --name <experiment_name> --model dastyle --dataset_mode real --is_train 0 --preprocess resize --norm batch --eval

When testing, it prints the results of evaluation metrics MSE, fMSE and PSNR.

python test_save.py --dataset_root <path_to_iHarmony4_dataset> --name <experiment_name> --model dastyle --dataset_mode real --is_train 0 --preprocess resize --norm batch --eval

The harmonized outputs would be saved in ./results/experiment_name/latest_test/images/.

Other Resources

Acknowledgements

Our code is developed based on pix2pix.