docker container 실행 (stylegan2-train)

 

python, tensorflow 버전 확인

 

기존 AnimeGANv2 레파지토리(impersonator++ 후보정에 사용)에 _old 붙이고 새로 git clone

[test.py]

python test.py --checkpoint_dir checkpoint/generator_Hayao_weight --test_dir dataset/test/HR_photo --save_dir Hayao/HR_photo

 

[train.py]

  • 학습데이터 디토님으로부터 전달 받음
  • vgg19.npy 다운 받아 이동
  • train dataset 다운로드
    • Genshin/style/ 아래 학습데이터 이동
    • 나머지 스타일 데이터 삭제
  • tools 아래 있던 edge_smooth.py 를 메인으로 꺼내옴

 

  1. edge_smooth.py
  • 경로 문제로 데이터를 읽어오지 못해서 아래와 같이 직접 경로 지정 (file_list)
    • train 시에는 sys.append 형식으로 명확하게 지정해야 할 듯
      • smooth 파일 저장할 때 ‘.' 하나가 부족해서 '/dataset/’ 에 저장되고 있었음
    • 4번째 epoch부터 샘플 저장함

 

2. train

 

python train.py --dataset Genshin --epoch 101 --init_epoch 5

tensorboard --logdir=./logs --bind_all
# http://192.168.0.4:6006/#scalars

 

[결과]

 

 

[inference]

  • get_generator_ckpt.py를 tools 폴더에서 꺼내옴
python get_generator_ckpt.py --checkpoint_dir ./checkpoint/AnimeGANv2_Genshin_lsgan_300_300_1_2_10_1 --style_name Genshin

  • generator_Genshin_weight 폴더 생성됨
  • video2anime.py
python video2anime.py --video video/input/big_boy-heymama-smoothing.mp4 --checkpoint_dir checkpoint/generator_Hayao_weight --output video/output

 

'인공지능 > computer vision' 카테고리의 다른 글

GAN실험 - Inversion of Input Images  (0) 2022.08.12
GAN실험 - few-shot GAN adaptation  (0) 2022.08.12
GAN실험 - FreezeG  (0) 2022.08.11
GAN실험 - GANspace  (0) 2022.08.10
GAN실험 - model blending & projection  (0) 2022.08.10
복사했습니다!