This repo contains a PyTorch from-scratch implementation of the paper Towards the Automatic Anime Characters Creation with Generative Adversarial Networks.
Generating 二次元(にじげん) MOEst avatars...
generated avatars from my pre-trained model. Some avatars seem strange. I need to add some tricks and continue training it.- Python 3.6
- Python-OpenCV 3.4.0
- pyquery 1.2.4
- i2v 1.0.0
- PyTorch 0.4.0
- GPU is better :-D
- and so on.
This is an unfinished repo. I'm training the models and completing the README.md under src >.<
I want to call it a DRAGAN-like SRGAN structure because I use the gradient penalty as the paper told and two SRResNet as discriminator and generator. The SRResNet(modified as the paper described) are like this:
I have some modifications in this structure:
-
I weighted label's loss and tag's loss with half of λadv beacause the loss described in the paper was so hard-core for me. (More details please refer in src/model/gan.py)
-
Remove the sigmoid operation in adversarial loss calculating since the results with sigmoid layer may cause some problems.
-
Using Multi-Label Soft Margin Loss for tags' loss calculating.(Cross Entropy Loss may better because of the imbalance of the images' tag distribution. But I don't have too much time for weights tuning. :-D )
-
Cause I built an extremely clean dataset for this task. I'm glad to share my data-Preparing method here.
-
Crawled the images from the website as the paper proposed. Read the readme and codes in src/dataset/Spider/ to get more information.
-
I used the lbpcascade_animeface model for face detecting. source codes are in src/dataset/FaceDetect/
-
illustration2vec was used for face tagging. Please check the files in src/tag/
-
Remove the invalid images manually.
- The discriminator and generator were defined in src/model/networks/.
- The training strategy of GAN was written in src/model/gan.py.
- Currently I have some simple tools for face data statistics. More details in src/statistics/dataset/.
Coming soon.