Intrinsic Image Harmonization

Overview

Intrinsic Image Harmonization [Paper]

Zonghui Guo, Haiyong Zheng, Yufeng Jiang, Zhaorui Gu, Bing Zheng

Here we provide PyTorch implementation and the trained model of our framework.

Prerequisites

  • Linux
  • Python 3
  • CPU or NVIDIA GPU + CUDA CuDNN

Train/Test

CUDA_VISIBLE_DEVICES=0 python train.py --model retinexltifpm  --name retinexltifpm_allihd  --dataset_root <dataset_dir> --dataset_name IHD --batch_size xx --init_port xxxx
  • Test the model
CUDA_VISIBLE_DEVICES=0 python test.py --model retinexltifpm  --name retinexltifpm_allihd  --dataset_root <dataset_dir> --dataset_name IHD --batch_size xx --init_port xxxx

Apply a pre-trained model

  • Download the pretrained model from Google Drive or BaiduCloud (access code: 20m6), and put net_G.pth in the directory checkpoints/experiment. Run:
CUDA_VISIBLE_DEVICES=0 python test.py --model retinexltifpm  --name experiment  --dataset_root <dataset_dir> --dataset_name IHD --batch_size xx --init_port xxxx

Evaluation

We provide the code in ih_evaluation.py. Run:

CUDA_VISIBLE_DEVICES=0 python evaluation/ih_evaluation.py --dataroot <dataset_dir> --result_root  results/experiment/test_latest/images/ --evaluation_type our --dataset_name ALL

Quantitative Result

Dataset Metrics Composite Ours
(iHarmony4)
Ours
(iHarmony4+HVIDIT)
HCOCO PSNR
MSE
fMSE
33.99
69.37
996.59
37.61
23.25
386.39
37.77
21.84
367.38
HAdobe5k PSNR
MSE
fMSE
28.52
345.54
2051.61
36.20
42.21
296.76
36.49
39.53
266.49
HFlickr PSNR
MSE
fMSE
28.43
264.35
1574.37
31.74
100.86
676.71
32.08
96.87
635.60
Hday2night PSNR
MSE
fMSE
34.36
109.65
1409.98
36.48
50.64
755.88
36.60
50.37
763.33
HVIDIT PSNR
MSE
fMSE
38.72
53.12
1604.41
-
-
-
41.83
22.49
691.06
ALL PSNR
MSE
fMSE
32.07
167.39
1386.12
36.53
37.95
399.34
36.96
35.33
388.50

Bibtex

If you use this code for your research, please cite our papers.

@InProceedings{Guo_2021_CVPR,
    author    = {Guo, Zonghui and Zheng, Haiyong and Jiang, Yufeng and Gu, Zhaorui and Zheng, Bing},
    title     = {Intrinsic Image Harmonization},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
    month     = {June},
    year      = {2021},
    pages     = {16367-16376}
}

Acknowledgement

For some of the data modules and model functions used in this source code, we need to acknowledge the repo of DoveNet and CycleGAN.

You might also like...
python library for invisible image watermark (blind image watermark)
python library for invisible image watermark (blind image watermark)

invisible-watermark invisible-watermark is a python library and command line tool for creating invisible watermark over image.(aka. blink image waterm

AOT-GAN for High-Resolution Image Inpainting (codebase for image inpainting)
AOT-GAN for High-Resolution Image Inpainting (codebase for image inpainting)

AOT-GAN for High-Resolution Image Inpainting Arxiv Paper | AOT-GAN: Aggregated Contextual Transformations for High-Resolution Image Inpainting Yanhong

Code for Dual Contrastive Learning for Unsupervised Image-to-Image Translation, NTIRE, CVPRW 2021.
Code for Dual Contrastive Learning for Unsupervised Image-to-Image Translation, NTIRE, CVPRW 2021.

arXiv Dual Contrastive Learning Adversarial Generative Networks (DCLGAN) We provide our PyTorch implementation of DCLGAN, which is a simple yet powerf

Deep Image Search is an AI-based image search engine that includes deep transfor learning features Extraction and tree-based vectorized search.
Deep Image Search is an AI-based image search engine that includes deep transfor learning features Extraction and tree-based vectorized search.

Deep Image Search - AI-Based Image Search Engine Deep Image Search is an AI-based image search engine that includes deep transfer learning features Ex

Third party Pytorch implement of Image Processing Transformer (Pre-Trained Image Processing Transformer arXiv:2012.00364v2)

ImageProcessingTransformer Third party Pytorch implement of Image Processing Transformer (Pre-Trained Image Processing Transformer arXiv:2012.00364v2)

[CVPR 2021] Teachers Do More Than Teach: Compressing Image-to-Image Models (CAT)
[CVPR 2021] Teachers Do More Than Teach: Compressing Image-to-Image Models (CAT)

CAT arXiv Pytorch implementation of our method for compressing image-to-image models. Teachers Do More Than Teach: Compressing Image-to-Image Models Q

Official implementation of "SinIR: Efficient General Image Manipulation with Single Image Reconstruction" (ICML 2021)

SinIR (Official Implementation) Requirements To install requirements: pip install -r requirements.txt We used Python 3.7.4 and f-strings which are in

This is the PyTorch implementation of GANs N’ Roses: Stable, Controllable, Diverse Image to Image Translation
This is the PyTorch implementation of GANs N’ Roses: Stable, Controllable, Diverse Image to Image Translation

Official PyTorch repo for GAN's N' Roses. Diverse im2im and vid2vid selfie to anime translation.

Accurate 3D Face Reconstruction with Weakly-Supervised Learning: From Single Image to Image Set (CVPRW 2019). A PyTorch implementation.
Accurate 3D Face Reconstruction with Weakly-Supervised Learning: From Single Image to Image Set (CVPRW 2019). A PyTorch implementation.

Accurate 3D Face Reconstruction with Weakly-Supervised Learning: From Single Image to Image Set —— PyTorch implementation This is an unofficial offici

Comments
  • Model Inference

    Model Inference

    Hello, is there a way to infer the model by reading an image and passing the image and its mask to the model and getting the harmonized output? Without the need to store the image's path in a text file and reading it from the text file then loading the image?

    opened by AhmedHashish123 2
  • visdom interface is blank

    visdom interface is blank

    first,thanks for your excellent work! When I execute the training code, the visdom interface does not display the result picture and the training loss. it works when I execute the code of dovenet. could you tell me how to solve this problem? thanks again

    opened by Ligouhi 0
Releases(v1.0)
Owner
VISION @ OUC
Underwater Vision Lab
VISION @ OUC
[ICCV'2021] "SSH: A Self-Supervised Framework for Image Harmonization", Yifan Jiang, He Zhang, Jianming Zhang, Yilin Wang, Zhe Lin, Kalyan Sunkavalli, Simon Chen, Sohrab Amirghodsi, Sarah Kong, Zhangyang Wang

SSH: A Self-Supervised Framework for Image Harmonization (ICCV 2021) code for SSH Representative Examples Main Pipeline RealHM DataSet Google Drive Pr

VITA 86 Dec 2, 2022
《Lerning n Intrinsic Grment Spce for Interctive Authoring of Grment Animtion》

Learning an Intrinsic Garment Space for Interactive Authoring of Garment Animation Overview This is the demo code for training a motion invariant enco

YuanBo 213 Dec 14, 2022
Code for "The Intrinsic Dimension of Images and Its Impact on Learning" - ICLR 2021 Spotlight

dimensions Estimating the instrinsic dimensionality of image datasets Code for: The Intrinsic Dimensionaity of Images and Its Impact On Learning - Phi

Phil Pope 41 Dec 10, 2022
Code for our NeurIPS 2021 paper 'Exploiting the Intrinsic Neighborhood Structure for Source-free Domain Adaptation'

Exploiting the Intrinsic Neighborhood Structure for Source-free Domain Adaptation (NeurIPS 2021) Code for our NeurIPS 2021 paper 'Exploiting the Intri

Shiqi Yang 53 Dec 25, 2022
Code of U2Fusion: a unified unsupervised image fusion network for multiple image fusion tasks, including multi-modal, multi-exposure and multi-focus image fusion.

U2Fusion Code of U2Fusion: a unified unsupervised image fusion network for multiple image fusion tasks, including multi-modal (VIS-IR, medical), multi

Han Xu 129 Dec 11, 2022
This repository contains several image-to-image translation models, whcih were tested for RGB to NIR image generation. The models are Pix2Pix, Pix2PixHD, CycleGAN and PointWise.

RGB2NIR_Experimental This repository contains several image-to-image translation models, whcih were tested for RGB to NIR image generation. The models

null 5 Jan 4, 2023
Image-to-Image Translation with Conditional Adversarial Networks (Pix2pix) implementation in keras

pix2pix-keras Pix2pix implementation in keras. Original paper: Image-to-Image Translation with Conditional Adversarial Networks (pix2pix) Paper Author

William Falcon 141 Dec 30, 2022
Learning Continuous Image Representation with Local Implicit Image Function

LIIF This repository contains the official implementation for LIIF introduced in the following paper: Learning Continuous Image Representation with Lo

Yinbo Chen 1k Dec 25, 2022
Official pytorch implementation of paper "Image-to-image Translation via Hierarchical Style Disentanglement".

HiSD: Image-to-image Translation via Hierarchical Style Disentanglement Official pytorch implementation of paper "Image-to-image Translation

null 364 Dec 14, 2022