Skip to content

This is a keras implementation of paper Image-to-Image Translation with Conditional Adversarial Networks

License

Notifications You must be signed in to change notification settings

hao-qiang/pix2pix_keras

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pix2pix implemented by keras

This is a keras implementation of paper Image-to-Image Translation with Conditional Adversarial Networks (pix2pix). I learned a lot from tdeboissiere's code.

Requirements

  • python 3.6
  • keras 2.1.5
  • tensorFlow 1.4
  • opencv 3.4.1

Getting Started

1. Preparing your data

All your training data and validation data should be processed into A2B form as shown in figure. Then moving the training images (3 channels) into folder ./data/train , and validation images into folder ./data/val .

2. Training

python train.py
  • Model pictures and generated validation pictures will be saved in folder ./figures, and weights will be saved in folder ./weights/pix2pix.

  • If you want to use perceptual loss, please replace loss = [l1_loss, 'binary_crossentropy'] (line44) by loss = [perceptual_loss, 'binary_crossentropy'] (line45) in train.py.

3. Testing

You need to change the path of folder testset_dir and save_dir , and run

python test.py

Have fun!

About

This is a keras implementation of paper Image-to-Image Translation with Conditional Adversarial Networks

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages