π¨ Anime generation with GANs.
Note: I have restructured the whole folder, cleaned up training code, pruned my dataset, and updated most of the results. You can see the old version of this repo in
old
.
Generate colorful anime characters using GAN.
By interpolating generator input, we can see some interesting results.
By fixing color classes and varying noise, we can generate anime characters with same colors but different identity.
I noticed that anime produced in different years have distinctive artistic styles. To name a few:
By conditioning the ACGAN on year labels, we can generate characters with different artistic styles.
Interpolating along the year latent code:
Modify config.yaml
as you wish.
> python3 run.py
The current dataset is a composition of 2 datasets:
The dataset format is as follows:
- images/
- XXXXX.jpg
- ...
- labels.pkl
- eye_label.json
- year_label.json
- hair_label.json
After loading in labels.pkl
with pickle, you will get a dictionary of { filname : labels }
. The labels are formatted as (eye, hair, year)
tuples.
{
"32455": (8, 10, 5),
...
}
This means
32455.jpg
has eye class 8, hair class 10, year class 5.
Missing labels will be a None
. All images from dataset 1 will have year labels None
, while all images from dataset 2 will have eye and hair label None
.
Source code in the current repo is used to train on the first dataset. This requires some manual preprocessing (see dataset/anime_dataset.py
) to extract the first dataset from the whole dataset.
The .json
files map discrete labels to semantics.
// eye_label.json
{
"aqua": 0,
"black": 1,
...
}
torchvisions.transforms.functional
methods.