You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Or use your own dataset by creating the appropriate folders and adding in the images.\n",
102
+
"\n",
103
+
"- Create a dataset folder under `/dataset` for your dataset.\n",
104
+
"- Create subfolders `testA`, `testB`, `trainA`, and `trainB` under your dataset's folder. Place any images you want to transform from a to b (cat2dog) in the `testA` folder, images you want to transform from b to a (dog2cat) in the `testB` folder, and do the same for the `trainA` and `trainB` folders."
"Change the `--dataroot` and `--name` to your own dataset's path and model's name. Use `--gpu_ids 0,1,..` to train on multiple GPUs and `--batch_size` to change the batch size. I've found that a batch size of 16 fits onto 4 V100s and can finish training an epoch in ~90s.\n",
161
+
"\n",
162
+
"Once your model has trained, copy over the last checkpoint to a format that the testing model can automatically detect:\n",
163
+
"\n",
164
+
"Use `cp ./checkpoints/horse2zebra/latest_net_G_A.pth ./checkpoints/horse2zebra/latest_net_G.pth` if you want to transform images from class A to class B and `cp ./checkpoints/horse2zebra/latest_net_G_B.pth ./checkpoints/horse2zebra/latest_net_G.pth` if you want to transform images from class B to class A.\n"
"- `python test.py --dataroot datasets/horse2zebra/testA --name horse2zebra_pretrained --model test --no_dropout`\n",
190
+
"\n",
191
+
"Change the `--dataroot` and `--name` to be consistent with your trained model's configuration.\n",
192
+
"\n",
193
+
"> from https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix:\n",
194
+
"> The option --model test is used for generating results of CycleGAN only for one side. This option will automatically set --dataset_mode single, which only loads the images from one set. On the contrary, using --model cycle_gan requires loading and generating results in both directions, which is sometimes unnecessary. The results will be saved at ./results/. Use --results_dir {directory_path_to_save_result} to specify the results directory.\n",
195
+
"\n",
196
+
"> For your own experiments, you might want to specify --netG, --norm, --no_dropout to match the generator architecture of the trained model."
197
+
]
198
+
},
199
+
{
200
+
"cell_type": "code",
201
+
"metadata": {
202
+
"id": "uCsKkEq0yGh0",
203
+
"colab_type": "code",
204
+
"colab": {}
205
+
},
206
+
"source": [
207
+
"!python test.py --dataroot datasets/horse2zebra/testA --name horse2zebra_pretrained --model test --no_dropout"
0 commit comments