Lightweight PyTorch implementation of pix2pix (https://arxiv.org/pdf/1611.07004.pdf). Pix2pix is a popular example of a conditional GAN that solves image-translation tasks. It uses classic GAN loss as well as L1-loss to produce photo-realistic images.
After 10 epochs
- Clone the repository
git clone https://github.com/ivankunyankin/pix2pix.git
cd pix2pix
- Create an environment and install the dependencies
python3 -m venv env
source env/bin/activate
pip3 install -r requirements.txt
The model in this repository was trained using Simpson Faces dataset from Kaggle. To be more precise using a cleaned (a bit) version of it.
I wanted to try to develop a model that will be able to generate realistic simpsons-style faces from sketch-like drawings. To do that I used OpenCV to extract contours from real images, then filtered out small ones and saved with white background trying to mimic real sketches. Certainly, there can be a way to make inputs much more similar to real sketch images. One can try to automate some sort of image distortion to do that.
To reproduce the results:
- Download the data. Link
- Prepare the data by running the following:
python3 prepare_data.py
This script will generate input images, save them and split them by train and val sets.
In order to start training you need to run:
python3 train.py
You can play around with hyper-parameters values. You will find them in the same script.
You can watch the training process and see the intermediate results in tensorboard. Run the following:
tensorboard --logdir logs