jiyegege / animeGanv2_pytorch

6 stars 0 forks source link
animegan gan pytorch

AnimeGANv2_Pytorch 中文

Reference source AnimeGANv2 project, rewritten with Pytorch to implement

Installation and testing environment

GPU:3060 batch_size=10 训练耗时为13min/epoch

Usage

Initialization training

python train.py --config_path config/config-init.yaml --init_train_flag True

Formal training

python train.py --config_path config/config-defaults.yaml --init_train_flag False --pre_train_weight checkpoint/initAnimeGan/Hayao/epoch\=4-step\=3330-v1.ckpt

Testing

python test.py --model_dir checkpoint/animeGan/Hayao/epoch=59-step=79920-v1.ckpt --test_file_path "dataset/test/HR_photo/1 (55).jpg"

Export Model

python export_model.py --checkpoint_path checkpoint/animeGan/Hayao/epoch=59-step=79920-v1.ckpt --dynamic

Training process

loss variation

Discriminator related losses

image-20220624202624359

Generator related losses

image-20220624202832128

Relative change in loss of generators and discriminators

image-20220624202944846

As can be seen from the loss, the generator and discriminator produced an obvious confrontation effect, the generator loss into an upward trend, discriminator loss into a downward trend, due to the training of the relevant loss weight is in accordance with the way recommended by the original author, and the original author training effect has a certain difference, you need to adjust again

Image verification results

图片1

pic2

pic3

License