Here I’ll give a brief intro about Docker Containers before jumping into how to train your models in Google AI Platform.
Deep fakes - the use of deep learning to swap one person's face into another in video - are one of the most interesting and frightening ways that AI is being used today.
While deep fakes can be used for legitimate purposes, they can also be used in disinformation. With the ability to easily swap someone's face into any video, can we really trust what our eyes are telling us? A real-looking video of a politician or actor doing or saying something shocking might not be real at all.
In this article series, we're going to show how deep fakes work, and show how to implement them from scratch. We'll then take a look at DeepFaceLab, which is the all-in-one Tensorflow-powered tool often used for creating convincing deep fakes.
In the previous article, I showed how to build, train, and implement autoencoders for deep fake creation. In this article, I’ll talk about Docker containers.
Docker is a widely used platform for developing, shipping and running apps. It’s written in Go and uses some principles from the Linux Kernel to deliver all the functionality that it can provide. Its major advantage is that it allows you to deliver software extremely quickly due to not having to worry about the underlying infrastructure. With Docker you can package and run any app in an isolated environment called a container, which is portable, very lightweight, and flexible.
Docker is based on the classic client-server architecture that most of us are familiar with. From their documentation, the Docker architecture is illustrated like this:
Let’s break down the image from above: the Docker daemon handles almost everything in this architecture. It manages the Docker API requests, as well as objects like images, containers and many other elements. Its flexibility allows it to communicate with other daemons. This to manage services in common.
On the other side, the Docker client allows you to interact with Docker through some commands that are sent to the daemon via the API. The Docker registry stores images that will be used to build containers later on, and a publicly available registry is Docker Hub, which is the default place that Docker uses to look for images when you try to pull one of these.
Docker images are simply templates used to build Docker containers. Regularly you’ll find images based on other images. For example, there could be a Docker image based on Ubuntu that’s been customized to be lightweight and have only the components necessary to make your application run.
Finally, Docker containers are small isolated environments, which are a runnable version of their images. They have everything required to be independent from the underlying host and any other container. There are several types of containers and their usage is totally defined by their image, but generally speaking you can customize whatever you want from them and therefore run anything you want on top of them.
For now, I need you to know that a Docker container is built from guidelines provided in Dockerfile, which contains some commands that specify how the container should be built.
I invite you to go and check out their documentation so you understand Docker in depth. In the next article I’ll show you how to train your deep fake models in the cloud with some help from Docker.
Sergio Virahonda grew up in Venezuela where obtained a bachelor's degree in Telecommunications Engineering. He moved abroad 4 years ago and since then has been focused on building meaningful data science career. He's currently living in Argentina writing code as a freelance developer.