Cartoonizer: Combining CartoonGAN and White-Box Cartoon Representations

Description

Cartoonizer is an interactive web application that transforms regular images into cartoon-like visuals. Utilizing state-of-the-art models like CartoonGAN and White-box Cartoonization, the application ensures high-quality cartoon effects that are visually appealing and closely resemble hand-drawn art.

Image Result Video Result

Demo Video

Project Structure

cartoon/
│
├── app.py                              # Main application file running the web server and handling requests
├── final.yaml                          # YAML configuration file
│
├── cartoonGAN/                         # Contains implementation and assets related to the CartoonGAN model
│   ├── generator_latest.pth           # Pre-trained generator model
│   └── transform.py                   # Transformation script using CartoonGAN
│
├── white_box_cartoonization/          # Contains implementation and assets for the White-box Cartoonization model
│   ├── cartoonize.py                  # Script to cartoonize images using White-box Cartoonization
│   └── saved_models/                  # Directory containing model files for white box cartoonization
│
├── static/                            # Directory to store static assets like images
│   ├── uploads/                       # Sample uploaded files
│   └── cartoons/                      # Sample cartoon images
│
└── templates/                         # Contains HTML templates defining the structure and look of web pages
    ├── index.html                     # Main HTML template for the web application
  • app.py: Main application file that runs the web server and handles user requests.
  • cartoonGAN: Implementation and assets related to the CartoonGAN model.
  • white_box_cartoonization: Implementation and assets for the White-box Cartoonization model.
  • static: Stores static assets like images.
  • templates: Contains HTML templates which define the structure and look of the web pages.
  • final.yaml: A YAML configuration file, possibly related to the environment or other settings.

Setting Up the Project

Using Anaconda (Recommended)

  1. Ensure that you have Anaconda or Miniconda installed.
  2. Navigate to the project directory.
  3. Create a new conda environment using the provided final.yaml file:conda env create -f final.yaml
  4. Activate the newly created environment:conda activate <env_name>

Replace <env_name> with the environment name specified in the final.yaml file.

Running the Web Application

  1. Ensure you're in the project directory.
  2. Run the app.py script:python app.py
  3. Open a web browser and navigate to the address shown in the console (usually http://127.0.0.1:5000/).

Behind the Scenes

  • CartoonGAN: Employs Generative Adversarial Networks, trained on a vast dataset of real-world images and their cartoon versions.
  • White-box Cartoonization: A model providing a unique cartoon style, allowing users to choose between different cartoonization effects.

Important Links

Authors

  • Nitya Parikh - UTA ID: 1002053645, NET ID: nxp3645
  • Mayank Vekariya - UTA ID: 1002078999, NET ID: mxv8999

Acknowledgments