8.3 KiB
8.3 KiB
In [0]:
!git clone https://github.com/junyanz/pytorch-CycleGAN-and-pix2pixIn [0]:
import os
os.chdir('pytorch-CycleGAN-and-pix2pix/')In [0]:
!pip install -r requirements.txtIn [0]:
!bash ./datasets/download_cyclegan_dataset.sh horse2zebraIn [0]:
!bash ./scripts/download_cyclegan_model.sh horse2zebraIn [0]:
!python train.py --dataroot ./datasets/horse2zebra --name horse2zebra --model cycle_ganIn [0]:
!python test.py --dataroot datasets/horse2zebra/testA --name horse2zebra_pretrained --model test --no_dropoutIn [0]:
import matplotlib.pyplot as plt
img = plt.imread('./results/horse2zebra_pretrained/test_latest/images/n02381460_1010_fake.png')
plt.imshow(img)In [0]:
import matplotlib.pyplot as plt
img = plt.imread('./results/horse2zebra_pretrained/test_latest/images/n02381460_1010_real.png')
plt.imshow(img)