AnimeGANv2 photo to a cartoon
In this tutorial, we will see how to use AnimeGANv2 to convert a cartoon image in just 4 steps. Before going on I suggest you download the notebook to use on google Colab and follow the instructions. No effort will be required for programming the installation of libraries but you just need a Gmail account, everything else will be done by the notebook and by the processing power of Google Colab.
4 fully automated steps are enough to achieve the result:
- Install AnimeGANv2
- Upload images
- Transfom photo to cartoon
- Download cartoonified images
This is what you will see when opening the file
1. Install AnimeGANv2
Start the cell and wait for all files to be installed. The installation will take less than a minute, no further action will be required and as soon as it is finished you can proceed with the other steps.
2. Upload images
You can upload the photos you prefer, photos of people, landscapes, animals, etc. It is important that the elements contained in the photo stand out well. For example, it will be easier to convert a dog in the foreground than a dog in the background.
You can use the format you prefer, for example, I use photos with the extension .jpg but I advise you to follow all my steps the first time and only then try new variations. Other image formats may give different results.
Now upload the photos to Google colab images folder. You can also do as I did, selecting all the photos from the folder and transporting them to colab.
3. Transfom photo to cartoon
This process takes from 30 seconds to 1 minute, of course, you have to keep in mind that the more images you put in the longer it will take. Consider an average of 30 seconds per image for processing.
4. Download cartoonified images
You can finally download the images. As you can see the result is very interesting and there is room for changes or improvements
What did I use for this tutorial with AnimeGANv2?
It is an Open Source project called AnimeGANv2 based on a Generative Adversarial Network (GAN) using deep learning with the aim of recognizing a specific pattern and transferring it to images. To understand the complexity of the project you can take a look at How do computers see images? – Opencv with Python or how to do this with the simple functions of OpenCV How to create a cartoon effect – Opencv with Python
This is a project developed by Xin Chen and I recommend that you read all the documentation on Github, I just put it in a notebook to make it easier to use but to exploit its full potential, the notebook is not enough.
For example, you can use your own pattern by training with your cartoon and much more, it is really an interesting project with a lot of potentials. For example, instead of images, you can convert an entire video.
Hi there, I’m the founder of Pysource.
I’m a Computer Vision Consultant, developer and Course instructor.
I help Companies and Freelancers to easily and efficiently build Computer Vision Software.
Learn to build Computer Vision Software easily and efficiently.
This is a FREE Workshop where I'm going to break down the 4 steps that are necessary to build software to detect and track any object.Sign UP for FREE
Detect and Track any Object (Full Videocourse)
You can Build Software to detect and track any Object even if you have a basic programming knowledge.