Summary
In this chapter, we trained a neural network to swap faces. To do this, we had to explore what convolutional layers are and then build a foundational upscaler layer. Then we built the three networks. We built the encoder, then two decoders. Finally, we trained the model itself, including loading and preparing images, and made sure we saved previews and the final weights.
First, we built the models of the neural networks that we were going to train to perform the face-swapping process. This was broken down into the upscaler, the shared encoder, and the two decoders. The upscaler is used to increase the size of the image by turning depth into a larger image. The encoder is used to encode the face image down into a smaller encoded space that we then pass to the decoders, which are responsible for re-creating the original image. We also looked at activation layers to understand why they’re helpful.
Next, we covered the training code. We created instances of the network...