Skip to content

CalvinGAN is a machine-generated Calvin and Hobbes style comic book. The goal of this project is to build a machine learning model that can generate recognizable comic images and text that have similar characteristics to Calvin and Hobbes.

Notifications You must be signed in to change notification settings

genericalexacc/CalvinGAN

Repository files navigation

CalvinGAN

THIS PROJECT REQUIRES CUDA GPU FOR TRAINING

Example of GAN generated comics

GAN project

./calvin_gan.py <--- main file containing the GAN model to train and for inference
./merge_image_and_text.ipynb <--- script to merge the GAN images and text file
./metrics.ipynb <--- Notebook to generate metrics on the dataset
./pdf_to_png.py <--- script to split pdf file of comics to png images
./split_page_to_panels.py <--- script to split png images in 4 to get only panels

  • The files should be run in the order: pdf_to_png.py split_page_to_panels.py calvin_gan.py merge_image_and_text.ipynb metrics.ipynb

  • GPU IS REQUIRED.

  • Training takes ~80 hours.

  • The training script saves files to a "weights" directory.

Conda environment

foo@bar:~$ conda env create --name calvin -f calvin.yaml
foo@bar:~$ conda activate calvin

To just try inference

  • Download weights bellow
foo@bar:~$ python calvin_gan.py generate 10

Preprocessing and training (REQUIRES CUDA GPU)

foo@bar:~$ python pdf_to_png.py
foo@bar:~$ python split_page_to_panels.py
foo@bar:~$ python calvin_gan.py train

For metrics and merging text and images look at the notebooks

foo@bar:~$ jupyter notebook

Download links

Download Comic https://www.pdfdrive.com/calvin-and-hobbes-sunday-pages-1985-1995-e156743420.html

Download Weights (folder "weights"): https://drive.google.com/file/d/1SelVENIDKvm3So1G1iTiAdFfkLZftkiG/view?usp=sharing

Download Real Calvin panels (folder "real"): https://drive.google.com/file/d/1Vq8qqhshJELoLFlvNOcN1ThJIi8DSGkE/view?usp=sharing

Download Fake Calvin panels (folder "image_bank"): https://drive.google.com/file/d/1DmE01n0fsuMIrSBiiDGyDVWswFnaGAID/view?usp=sharing

About

CalvinGAN is a machine-generated Calvin and Hobbes style comic book. The goal of this project is to build a machine learning model that can generate recognizable comic images and text that have similar characteristics to Calvin and Hobbes.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published