Justin Pinkney

MATLAB pix2pix 🏢

Last touched June 09, 2020

Of all the GAN architectures pix2pix is a personal favourite. It popularised the use of GANs for image to image translation, it’s nice and simple, trains relatively quickly, and invariably produces some surprisingly pleasant results. If you don’t know what pix2pix is, see the original project page which has some nice examples and a demo. Or just search Twitter for #pix2pix for some fun examples.

Input to the model on the left and output on the right
Input to the model on the left and output on the right

Since R2019b MATLAB has had support for automatic differentiation and it’s been possible to train GANs. So one of the first things I tried out was writing a MATLAB version of pix2pix (unlike Python it’s easy to be the first to write and implementation of a deep learning paper in MATLAB).

The classic example for pix2pix is the facades dataset and running this is gives similar results to the original paper (although training time is quite a lot slower).

I’ve released this as an open-source project on GitHub if you run into any problem please file an issue.

💬 If you want to comment say hello on Twitter.
© 2022, Justin Pinkney