Skip to content

AnimeFaces-GAN is a deep learning project focused on generating high-quality anime faces using Generative Adversarial Networks (GANs). Whether you are a researcher, a developer, or an enthusiast, AnimeFaces-GAN provides a solid foundation and a flexible framework to experiment with and enhance your machine learning projects.

Notifications You must be signed in to change notification settings

PJF9/Animefaces-GAN

Repository files navigation

Animefaces-GAN

This project aims to generate anime faces using Generative Adversarial Networks (GANs). We have implemented and trained a generator and a discriminator model to achieve this task.

Installation

  1. Clone the repository:
git clone https://github.com/PJF9/Animefaces-GAN.git)
cd AnimeFaces-GAN
  1. Create a virtual environment and activate it:
python -m venv env
source env/bin/activate  # On Windows use `env\Scripts\activate`
  1. Install the dependencies:
pip install -r requirements.txt

Configuration

  1. Add kaggle.json file to /home/usr/.kaggle (you can generate a key here.)

  2. Modify src/config.py as needed to adjust the settings as you prefer.

Usage

  1. To downlaod the dataset, run:
python3 data.py
  1. To train the GAN models, run:
python3 train.py
  1. To make a single prediction, run:
python3 predict.py

Modules

Models

  • generator.py: Defines the generator model architecture.
  • discriminator.py: Defines the discriminator model architecture.

Trainers

  • trainer.py: Contains the training loop for the GAN models.

Utils

  • data.py: Handles data loading and preprocessing.
  • device.py: Manages device configuration (CPU/GPU).
  • log.py: Contains logging functionalities.
  • save.py: Functions for saving models and outputs
  • visualization.py: Functions for visualizing generated images.
  • config.py: Handles configuration file parsing.

Scripts

  • data.py: Script to preprocess the dataset.
  • train.py: Script to start training the GAN models.
  • predict.py: Script to generate images using the trained generator model.

Additional Notes

While running the scripts, some extra directories will be created:

  • ./checkpoints (config.MODELS_PATH): This directory will save all the checkpoints of training and the best generator model.
  • ./plots (config.PLOTS_PATH): This directory will save the loss curves after training.
  • ./generated (config.IMAGES_PATH): This directory will save the generated images during training and the results from the predict.py script.

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or suggestions.

About

AnimeFaces-GAN is a deep learning project focused on generating high-quality anime faces using Generative Adversarial Networks (GANs). Whether you are a researcher, a developer, or an enthusiast, AnimeFaces-GAN provides a solid foundation and a flexible framework to experiment with and enhance your machine learning projects.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages