pytorch AdaIN
v0.0.0
이것은 적응 형 인스턴스 정규화를 통해 실시간의 임의 스타일 전송, 논문의 비공식 Pytorch 구현이다 [Huang+, ICCV2017]. 저자의 Torch의 원래 구현에 정말 감사합니다. 매우 유용합니다.

pip install -r requirements.txt 으로 요구 사항을 설치하십시오
(선택 사항, 훈련을위한)
Decoder.pth / vgg_normalized.pth를 릴리스에서 다운로드하여 models/ 에 넣습니다.
--content 및 --style 사용하여 컨텐츠 및 스타일 이미지에 대한 각 경로를 제공하십시오.
CUDA_VISIBLE_DEVICES=<gpu_id> python test.py --content input/content/cornell.jpg --style input/style/woman_with_hat_matisse.jpg
--content_dir 및 --style_dir 사용하여 컨텐츠 및 스타일 이미지 디렉토리에서 코드를 실행할 수도 있습니다. 컨텐츠와 스타일의 모든 조합을 출력 디렉토리에 저장합니다.
CUDA_VISIBLE_DEVICES=<gpu_id> python test.py --content_dir input/content --style_dir input/style
이것은 --style 및 --style_interpolation_weights 옵션을 지정하여 4 가지 스타일을 혼합하는 예입니다.
CUDA_VISIBLE_DEVICES=<gpu_id> python test.py --content input/content/avril.jpg --style input/style/picasso_self_portrait.jpg,input/style/impronte_d_artista.jpg,input/style/trial.jpg,input/style/antimonocromatismo.jpg --style_interpolation_weights 1,1,1,1 --content_size 512 --style_size 512 --crop
다른 옵션 :
--content_size : 컨텐츠 이미지의 새 (최소) 크기. 원래 크기를 0으로 설정하면 유지하십시오.--style_size : 컨텐츠 이미지의 새로운 (최소) 크기. 원래 크기를 0으로 설정하면 유지하십시오.--alpha : 양식화 정도를 조정하십시오. 0.0에서 1.0 (기본값) 사이의 값이어야합니다.--preserve_color : 컨텐츠 이미지의 색상을 보존하십시오. --content_dir 및 --style_dir 사용하여 컨텐츠 및 스타일 이미지에 해당 디렉토리를 제공하십시오.
CUDA_VISIBLE_DEVICES=<gpu_id> python train.py --content_dir <content_dir> --style_dir <style_dir>
자세한 내용 및 매개 변수는 -헬프 옵션을 참조하십시오.
이 코드로 교육 된 모델을 릴리스시 iter_1000000.pth 로 공유합니다.