This model transforms people's faces into a comic.
Using the PyTorch library, the pix2pix GAN architecture was implemented:
- U-net was used as a generator for images with a resolution of 128x128;
- A classical neural network with convolution in the last layer (PathGAN architecture) was used as a discriminator
Comic faces (paired, synthetic) was used as a dataset:
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:
In the arguments of the load_model method, after the model, specify the paths to the discriminator and generator weights
Run file bot.py
- In console of your computer
- In cell of notebook (.ipynb) (example:
!python3 /kaggle/input/gan-tg-bot/bot.py
)
To get started, write "/start"