Practical overview
When it fits
Use it when you have source, destination and mask images and want to run GP-GAN’s learned blending workflow, or when you need its documented training scripts for research.
Who it is for
- Developers seeking a command-line image-compositing implementation.
- Computer-vision and graphics researchers exploring learned image blending.
- Image-editing workflows that need to integrate a selected source region into a destination scene.
Documented uses
- Blend a source image into a destination using a supplied mask.
- Generate a composite image with a provided pretrained model.
- Train the supervised blending model on cropped Transient Attributes Dataset images.
- Train the unsupervised model using an outdoor-image dataset.
Requirements & limits
The repository is public and distributed under the MIT license.
- The core workflow requires a separate pretrained model download and placement in the models folder.
- The README specifies Python 3.5, Chainer 6.3.0 and Ubuntu 16.04 LTS as its tested environment.
- Supervised training uses cropped Transient Attributes Dataset images; unsupervised training requires an outdoor-image HDF5 dataset and the Fuel package.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Run GP-GAN with a pretrained blending model
Create a blended image from source, destination and mask files using the documented command-line workflow.
Before you start
- Python 3.5, Chainer 6.3.0 and Ubuntu 16.04 LTS are the environment specified in the README.
- The repository and its requirements installed.
- A pretrained model file, either blending_gan.npz or unsupervised_blending_gan.npz, placed in the models folder.
- Source image, destination image and mask files.
Steps
Clone the repository and enter its directory.
Install dependencies with pip install -r requirements/test/requirements.txt.
Download a pretrained model and place it in the models folder.
Run run_gp_gan.py with --src_image, --dst_image, --mask_image and --blended_image paths; for the unsupervised model, add --supervised False.
Expected outcome
The script is configured to write the blended image to the path supplied with --blended_image.
Guide limitations
- The README identifies the versions and operating system used for testing; it does not establish compatibility with other environments.
- The model files are downloaded separately from the repository.
Train the supervised blending model
Prepare the documented Transient Attributes Dataset images and start supervised GP-GAN training.
Before you start
- The repository dependencies installed.
- The Transient Attributes Dataset, including its imageAlignedLD data.
Steps
Download the Transient Attributes Dataset.
Run crop_aligned_images.py with --data_root set to the imageAlignedLD path.
Run train_blending_gan.py with --data_root set to the path for the cropped aligned images.
Expected outcome
The documented training script begins training the blending GAN on the cropped dataset.
Guide limitations
- This recipe covers the supervised training stages listed in the README, not a complete evaluation or deployment workflow.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 16 October 2026
- Original website title
- wuhuikai/GP-GAN · Official homepage title · retained in its source language

