Skip to content

janaSunrise/Anime-face-generation-DCGAN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Anime face generation using DCGAN

An interesting and special GAN method consisting of convolutional layers to generate pixel perfect anime images.

Installation and usage

This project uses pipenv for dependency management. You need to ensure that you have pipenv installed on your system.

Here's how to install the dependencies, and get started.

  • Install it using pipenv sync -d
  • Once done, spawn a shell to run the files: pipenv shell

And you're done, and you can run any of the files, and test them.

Project structure

This project is structured as follows,

  • src/ Contains the python scripts for training the ML Models.
  • notebooks/ contains the jupyter notebooks with explanations and the outputs of our end goal.
  • models/ contains the exported model to make your work easy.
  • resources/ contain the extra things for usage.

Generating datasets

I have personally used some kaggle datasets to train the model. You can also use the script as I have provided in the repository, or download any one dataset as shown in the script, or make your own following the steps given below.

Here are the kaggle datasets I suggest using for training.

I personally recommend using either one of them, or Making a good one yourself from scratch. You could use my script to download and combine the datasets too if you want.

To make your own, Here are the steps. You need a scraper tool called gallery-dl to download the images first, and then use Animeface to process the images and get the faces.

  • Download the images using gallery-dl. Here is a python script to automate it. Note, You need the tags in a file called tags.txt in same folder. The tags are pre-added in the repo, inside the resources folder.
    import os
    
    with open("tags.txt", "r") as f:
      tags = f.read()
    
    for tag in tags.split("\n"):
      os.system(f'gallery-dl --images 1000 "https://danbooru.donmai.us/posts?tags={tag}"')
  • Once done, You can follow the anime face documentation and process the data and then build the dataset out of it.

Contributing

Contributions, issues and feature requests are welcome. After cloning & setting up project locally, you can just submit a PR to this repo and it will be deployed once it's accepted.

⚠️ It’s good to have descriptive commit messages, or PR titles so that other contributors can understand about your commit or the PR Created. Read conventional commits before making the commit message.

Show your support

We love people's support in growing and improving. Be sure to leave a ⭐️ if you like the project and also be sure to contribute, if you're interested!

Made by Sunrit Jana with ♥

About

An interesting and special GAN method consisting of convolutional layers to generate pixel perfect anime images.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published