The premise for this project is to automatically texturize Polandball outlines with any arbitrary flag.
This project has only been tested using Anaconda environments. Packages can probably be installed in vanilla Python as well.
Install the polandball_mapping
environment through environment.yml
:
conda env create -f environment.yml
-
Download the dataset from https://www.kaggle.com/zimonitrome/polandball-characters
-
Put the
balls
andflags
folders into./data/
. -
Run the first pre-processing from the main directory:
python ./preprocessing/process_traning_data.py
This script can take some time but can be run in multiple instances.
Also consider not using 100% of the dataset. -
Train the GMM in phase 1:
python ./training/train_GMM_phase1.py
Note that no CLI options are provided. Training parameters are set in each training file.
The trained model will be saved in
./training/checkpoints/GMM_P1_***/***.pth
. -
Move the trained model to
main_weights
and rename it toGMM.pth
.Train the GMM in phase 2:
python ./training/train_GMM_phase2.py
-
Run the second pre-processing step now that a valid GMM model is available:
python ./preprocessing/process_traning_data_BSM.py
-
Train the BSM:
python ./training/train_BSM.py
-
Done! Make note of where your saved model (
.pth
) files are stored for use in inference.
To try the model, please refer to inference_demo.ipynb
.
The pre-trained weights ./main_weights/GMM.pth
and ./main_weights/BSM.pth
must exist (will soon be published!).
Architecture of the two models.
Inputs and outputs using different settings.
Performance for each different set of settings.
@inproceedings{arvidsson2021texture,
title={Texture Mapping of Flags onto Polandball Characters using Convolutional Neural Nets},
author={Arvidsson, Simon and Gabrielsson, Patrick and Johansson, Ulf},
booktitle={2021 International Joint Conference on Neural Networks (IJCNN)},
pages={1--7},
year={2021},
organization={IEEE}
}