• Stars
    star
    448
  • Rank 97,523 (Top 2 %)
  • Language
    Python
  • License
    MIT License
  • Created over 7 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Official Chainer implementation of GP-GAN: Towards Realistic High-Resolution Image Blending (ACMMM 2019, oral)

GP-GAN: Towards Realistic High-Resolution Image Blending (ACMMM 2019, oral)

[Project] [Paper] [Demo] [Related Work: A2RL (for Auto Image Cropping)] [Colab]
Official Chainer implementation of GP-GAN: Towards Realistic High-Resolution Image Blending

Overview

source destination mask composited blended

The author's implementation of GP-GAN, the high-resolution image blending algorithm described in:
"GP-GAN: Towards Realistic High-Resolution Image Blending"
Huikai Wu, Shuai Zheng, Junge Zhang, Kaiqi Huang

Given a mask, our algorithm can blend the source image and the destination image, generating a high-resolution and realsitic blended image. Our algorithm is based on deep generative models Wasserstein GAN.

Contact: Hui-Kai Wu ([email protected])

Citation

@article{wu2017gp,
  title   = {GP-GAN: Towards Realistic High-Resolution Image Blending},
  author  = {Wu, Huikai and Zheng, Shuai and Zhang, Junge and Huang, Kaiqi},
  journal = {ACMMM},
  year    = {2019}
}

Getting started

  • The code is tested with python==3.5 and chainer==6.3.0 on Ubuntu 16.04 LTS.

  • Download the code from GitHub:

    git clone https://github.com/wuhuikai/GP-GAN.git
    cd GP-GAN
  • Install the requirements:

    pip install -r requirements/test/requirements.txt
  • Download the pretrained model blending_gan.npz or unsupervised_blending_gan.npz from Google Drive, and then put them in the folder models.

  • Run the script for blending_gan.npz:

    python run_gp_gan.py --src_image images/test_images/src.jpg --dst_image images/test_images/dst.jpg --mask_image images/test_images/mask.png --blended_image images/test_images/result.png

    Or run the script for unsupervised_blending_gan.npz:

    python run_gp_gan.py --src_image images/test_images/src.jpg --dst_image images/test_images/dst.jpg --mask_image images/test_images/mask.png --blended_image images/test_images/result.png --supervised False
  • Type python run_gp_gan.py --help for a complete list of the arguments.

Train GP-GAN step by step

Train Blending GAN

  • Download Transient Attributes Dataset here.

  • Crop the images in each subfolder:

    python crop_aligned_images.py --data_root [Path for imageAlignedLD in Transient Attributes Dataset]
  • Train Blending GAN:

    python train_blending_gan.py --data_root [Path for cropped aligned images of Transient Attributes Dataset]
  • Training Curve

  • Visual Result

    Training Set Validation Set

Training Unsupervised Blending GAN

  • Requirements

    pip install git+git://github.com/mila-udem/fuel.git@stable
  • Download the hdf5 dataset of outdoor natural images: ourdoor_64.hdf5 (1.4G), which contains 150K landscape images from MIT Places dataset.

  • Train unsupervised Blending GAN:

    python train_wasserstein_gan.py --data_root [Path for outdoor_64.hdf5]
  • Training Curve

  • Samples after training

Visual results

Mask Copy-and-Paste Modified-Poisson Multi-splines Supervised GP-GAN Unsupervised GP-GAN

More Repositories

1

FastFCN

FastFCN: Rethinking Dilated Convolution in the Backbone for Semantic Segmentation.
Python
835
star
2

DeepGuidedFilter

Official Implementation of Fast End-to-End Trainable Guided Filter, CVPR 2018
Python
823
star
3

FaceSwap

Swap face between two photos.
Python
691
star
4

TF-A2RL

The official implementation for A2-RL: Aesthetics Aware Rinforcement Learning for Automatic Image Cropping
Python
189
star
5

MSC

MSC: A Dataset for Macro-Management in StarCraft II
Python
138
star
6

PointCloudSuperResolution

Point Cloud Super Resolution with Adversarial Residual Graph Networks
Python
56
star
7

SparseMask

SparseMask: Differentiable Connectivity Learning for Dense Image Prediction.
Python
51
star
8

chainer-pix2pix

Chainer implementation for Image-to-Image Translation Using Conditional Adversarial Networks
Python
39
star
9

DeepCV

A set of RESTful APIs for computer vision and image processing with PyTorch and Flask.
HTML
8
star
10

chainer-neural-style

Chainer implementation for Neural Style Transfer & Fast Neural Style Transfer
Python
6
star
11

chainer-realism-cnn

Chainer implementation for realismCNN.
Python
6
star
12

a3c-deepmind-pytorch

Python
6
star
13

pytorch-a3c

Python
3
star
14

SIFT

SIFT in C++
C++
3
star
15

pytorch-dqn-universe

Deep Reinforcement learning with pytorch on universe platform
Python
2
star
16

GP-GAN-Project

Project Website for GP-GAN: Towards Realistic High-Resolution Image Blending
HTML
2
star
17

wuhuikai

2
star
18

CNN_CUT

Using CNN to boot up GrabCut
C++
2
star
19

FastFCNProject

HTML
1
star
20

ProximalGradientOptimization

Python source code & example for use proximal gradient optimization
Python
1
star
21

DeepDrone

A python library for running image (video) processing, computer vision, and deep learning algorithms on Tello (DJI drone).
Python
1
star
22

DeepJS

HTML
1
star
23

DeepGuidedFilterProject

HTML
1
star