Skip to content

zimonitrome/polandball-flag-mapping

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Polandball Flag Mapping

The premise for this project is to automatically texturize Polandball outlines with any arbitrary flag.

Dependencies

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

Training

  1. Download the dataset from https://www.kaggle.com/zimonitrome/polandball-characters

  2. Put the balls and flags folders into ./data/.

  3. 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.

  4. 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.

  5. Move the trained model to main_weights and rename it to GMM.pth.

    Train the GMM in phase 2:

    python ./training/train_GMM_phase2.py
  6. Run the second pre-processing step now that a valid GMM model is available:

    python ./preprocessing/process_traning_data_BSM.py
  7. Train the BSM:

    python ./training/train_BSM.py
  8. Done! Make note of where your saved model (.pth) files are stored for use in inference.

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!).

Examples

Architecture of the two models.


Inputs and outputs using different settings.


Performance for each different set of settings.

Cite

@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}
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published