Code Monkey home page Code Monkey logo

calvingan's Introduction

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

calvingan's People

Contributors

genericalexacc avatar

Stargazers

manhcuongtin4 avatar cousepig avatar Aadarsh Jha avatar  avatar Li Xin Rui avatar  avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.