Introduction
In this tutorial, we are taking images captured by an iPhone camera and transforming them to their anime form. There are 3 differents models to select from, each yielding their own anime version. hayao-v2 generates the best results.
Codebase Updates
- I forked this repo
https://github.com/ptran1203/pytorch-animeGANto fix a dependency (described below) that was breaking the image conversion process. These changes were made in theinference.pyfile. I commented out incorrect lines 16 & 148 and made the corrections in lines 17 & 149. - I added the
model_weightsdirectory and downloaded & stored the pytorch models directly in the repo. Then, in theutils/common.pyfile, I made changes in theRELEASED_WEIGHTSvariable and theload_state_dict(weight, map_location)function, so that the models are being loaded directly from the repo rather than being downloaded from the GitHub URLs every time in theRELEASED_WEIGHTSvariable. - Finally, I added a
resultsdirectory with two sub-directories (original&animeify) which contain our original and converted images.
Generating & Comparing Results
Beatrix
Original

hayao:v2
To generate results, execute this command in your terminal: python3 inference.py --weight hayao:v2 --src results/original/beatrix.jpg --out results/animeify/beatrix_hayao_v2.jpg 
shinkai:v2
To generate results, execute this command in your terminal: python3 inference.py --weight shinkai:v2 --src results/original/beatrix.jpg --out results/animeify/beatrix_shinkai_v2.jpg 
arcane:v2
To generate results, execute this command in your terminal: python3 inference.py --weight arcane:v2 --src results/original/beatrix.jpg --out results/animeify/beatrix_arcane_v2.jpg 
Frank
Original

hayao:v2
To generate results, execute this command in your terminal: python3 inference.py --weight hayao:v2 --src results/original/frank.jpg --out results/animeify/frank_hayao_v2.jpg 
shinkai:v2
To generate results, execute this command in your terminal: python3 inference.py --weight shinkai:v2 --src results/original/frank.jpg --out results/animeify/frank_shinkai_v2.jpg 
arcane:v2
To generate results, execute this command in your terminal: python3 inference.py --weight arcane:v2 --src results/original/frank.jpg --out results/animeify/frank_arcane_v2.jpg 