Skip to content

michael-bmstu/pix2pix_gan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pix2pix with GAN

Description


This model transforms people's faces into a comic.


Architecture

Using the PyTorch library, the pix2pix GAN architecture was implemented:

  1. U-net was used as a generator for images with a resolution of 128x128;
  2. A classical neural network with convolution in the last layer (PathGAN architecture) was used as a discriminator

Dataset

Comic faces (paired, synthetic) was used as a dataset:

Learning

During the training, nn.L1Loss() (Mean Absolute Error) and nn.BCEWithLogitsLoss() were used.

torch.optim.Adam() was used as optimazer.

Start training:

During training:

End of training:

Usage

In the arguments of the load_model method, after the model, specify the paths to the discriminator and generator weights

image

Run file bot.py

  1. In console of your computer
  2. In cell of notebook (.ipynb) (example: !python3 /kaggle/input/gan-tg-bot/bot.py)

Link to the Bot

https://t.me/face2comic_bot

To get started, write "/start"

Examples