[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-2237":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":22,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":37,"readmeContent":38,"aiSummary":39,"trendingCount":16,"starSnapshotCount":16,"syncStatus":40,"lastSyncTime":41,"discoverSource":42},2237,"pytorch-CycleGAN-and-pix2pix","junyanz\u002Fpytorch-CycleGAN-and-pix2pix","junyanz","Image-to-Image Translation in PyTorch","",null,"Python",25149,6570,338,566,0,9,48,3,79.3,"Other",false,"master",true,[26,27,28,29,30,31,32,33,34,35,36],"computer-graphics","computer-vision","cyclegan","deep-learning","gan","gans","generative-adversarial-network","image-generation","image-manipulation","pix2pix","pytorch","2026-06-12 04:00:13","\u003Cimg src='imgs\u002Fhorse2zebra.gif' align=\"right\" width=384>\n\n\u003Cbr>\u003Cbr>\u003Cbr>\n\n# CycleGAN and pix2pix in PyTorch\n\n**Udpate in 2025**: we recently updated the code to support Python 3.11 and PyTorch 2.4. It also supports DDP for single-machine multiple-GPU training. (Please use `torchrun --nproc_per_node=4 train.py ...`)\n\n**New**: Please check out [img2img-turbo](https:\u002F\u002Fgithub.com\u002FGaParmar\u002Fimg2img-turbo) repo that includes both pix2pix-turbo and CycleGAN-Turbo. Our new one-step image-to-image translation methods can support both paired and unpaired training and produce better results by leveraging the pre-trained StableDiffusion-Turbo model. The inference time for 512x512 image is 0.29 sec on A6000 and 0.11 sec on A100.\n\nPlease check out [contrastive-unpaired-translation](https:\u002F\u002Fgithub.com\u002Ftaesungp\u002Fcontrastive-unpaired-translation) (CUT), our new unpaired image-to-image translation model that enables fast and memory-efficient training.\n\nWe provide PyTorch implementations for both unpaired and paired image-to-image translation.\n\nThe code was written by [Jun-Yan Zhu](https:\u002F\u002Fgithub.com\u002Fjunyanz) and [Taesung Park](https:\u002F\u002Fgithub.com\u002Ftaesungp), and supported by [Tongzhou Wang](https:\u002F\u002Fgithub.com\u002FSsnL).\n\nThis PyTorch implementation produces results comparable to or better than our original Torch software. If you would like to reproduce the same results as in the papers, check out the original [CycleGAN Torch](https:\u002F\u002Fgithub.com\u002Fjunyanz\u002FCycleGAN) and [pix2pix Torch](https:\u002F\u002Fgithub.com\u002Fphillipi\u002Fpix2pix) code in Lua\u002FTorch.\n\n**Note**: The current software works well with PyTorch 2.4+. Check out the older [branch](https:\u002F\u002Fgithub.com\u002Fjunyanz\u002Fpytorch-CycleGAN-and-pix2pix\u002Ftree\u002Fpytorch0.3.1) that supports PyTorch 0.1-0.3.\n\nYou may find useful information in [training\u002Ftest tips](docs\u002Ftips.md) and [frequently asked questions](docs\u002Fqa.md). To implement custom models and datasets, check out our [templates](#custom-model-and-dataset). To help users better understand and adapt our codebase, we provide an [overview](docs\u002Foverview.md) of the code structure of this repository.\n\n**CycleGAN: [Project](https:\u002F\u002Fjunyanz.github.io\u002FCycleGAN\u002F) | [Paper](https:\u002F\u002Farxiv.org\u002Fpdf\u002F1703.10593.pdf) | [Torch](https:\u002F\u002Fgithub.com\u002Fjunyanz\u002FCycleGAN) |\n[Tensorflow Core Tutorial](https:\u002F\u002Fwww.tensorflow.org\u002Ftutorials\u002Fgenerative\u002Fcyclegan) | [PyTorch Colab](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fjunyanz\u002Fpytorch-CycleGAN-and-pix2pix\u002Fblob\u002Fmaster\u002FCycleGAN.ipynb)**\n\n\u003Cimg src=\"https:\u002F\u002Fjunyanz.github.io\u002FCycleGAN\u002Fimages\u002Fteaser_high_res.jpg\" width=\"800\"\u002F>\n\n**Pix2pix: [Project](https:\u002F\u002Fphillipi.github.io\u002Fpix2pix\u002F) | [Paper](https:\u002F\u002Farxiv.org\u002Fpdf\u002F1611.07004.pdf) | [Torch](https:\u002F\u002Fgithub.com\u002Fphillipi\u002Fpix2pix) |\n[Tensorflow Core Tutorial](https:\u002F\u002Fwww.tensorflow.org\u002Ftutorials\u002Fgenerative\u002Fpix2pix) | [PyTorch Colab](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fjunyanz\u002Fpytorch-CycleGAN-and-pix2pix\u002Fblob\u002Fmaster\u002Fpix2pix.ipynb)**\n\n\u003Cimg src=\"https:\u002F\u002Fphillipi.github.io\u002Fpix2pix\u002Fimages\u002Fteaser_v3.png\" width=\"800px\"\u002F>\n\n**[EdgesCats Demo](https:\u002F\u002Faffinelayer.com\u002Fpixsrv\u002F) | [pix2pix-tensorflow](https:\u002F\u002Fgithub.com\u002Faffinelayer\u002Fpix2pix-tensorflow) | by [Christopher Hesse](https:\u002F\u002Ftwitter.com\u002Fchristophrhesse)**\n\n\u003Cimg src='imgs\u002Fedges2cats.jpg' width=\"400px\"\u002F>\n\nIf you use this code for your research, please cite:\n\nUnpaired Image-to-Image Translation using Cycle-Consistent Adversarial Networks.\u003Cbr>\n[Jun-Yan Zhu](https:\u002F\u002Fwww.cs.cmu.edu\u002F~junyanz\u002F)\\*, [Taesung Park](https:\u002F\u002Ftaesung.me\u002F)\\*, [Phillip Isola](https:\u002F\u002Fpeople.eecs.berkeley.edu\u002F~isola\u002F), [Alexei A. Efros](https:\u002F\u002Fpeople.eecs.berkeley.edu\u002F~efros). In ICCV 2017. (\\* equal contributions) [[Bibtex]](https:\u002F\u002Fjunyanz.github.io\u002FCycleGAN\u002FCycleGAN.txt)\n\nImage-to-Image Translation with Conditional Adversarial Networks.\u003Cbr>\n[Phillip Isola](https:\u002F\u002Fpeople.eecs.berkeley.edu\u002F~isola), [Jun-Yan Zhu](https:\u002F\u002Fwww.cs.cmu.edu\u002F~junyanz\u002F), [Tinghui Zhou](https:\u002F\u002Fpeople.eecs.berkeley.edu\u002F~tinghuiz), [Alexei A. Efros](https:\u002F\u002Fpeople.eecs.berkeley.edu\u002F~efros). In CVPR 2017. [[Bibtex]](https:\u002F\u002Fwww.cs.cmu.edu\u002F~junyanz\u002Fprojects\u002Fpix2pix\u002Fpix2pix.bib)\n\n## Talks and Course\n\npix2pix slides: [keynote](http:\u002F\u002Fefrosgans.eecs.berkeley.edu\u002FCVPR18_slides\u002Fpix2pix.key) | [pdf](http:\u002F\u002Fefrosgans.eecs.berkeley.edu\u002FCVPR18_slides\u002Fpix2pix.pdf),\nCycleGAN slides: [pptx](http:\u002F\u002Fefrosgans.eecs.berkeley.edu\u002FCVPR18_slides\u002FCycleGAN.pptx) | [pdf](http:\u002F\u002Fefrosgans.eecs.berkeley.edu\u002FCVPR18_slides\u002FCycleGAN.pdf)\n\nCycleGAN course assignment [code](http:\u002F\u002Fwww.cs.toronto.edu\u002F~rgrosse\u002Fcourses\u002Fcsc321_2018\u002Fassignments\u002Fa4-code.zip) and [handout](http:\u002F\u002Fwww.cs.toronto.edu\u002F~rgrosse\u002Fcourses\u002Fcsc321_2018\u002Fassignments\u002Fa4-handout.pdf) designed by Prof. [Roger Grosse](http:\u002F\u002Fwww.cs.toronto.edu\u002F~rgrosse\u002F) for [CSC321](http:\u002F\u002Fwww.cs.toronto.edu\u002F~rgrosse\u002Fcourses\u002Fcsc321_2018\u002F) \"Intro to Neural Networks and Machine Learning\" at University of Toronto. Please contact the instructor if you would like to adopt it in your course.\n\n## Colab Notebook\n\nTensorFlow Core CycleGAN Tutorial: [Google Colab](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Ftensorflow\u002Fdocs\u002Fblob\u002Fmaster\u002Fsite\u002Fen\u002Ftutorials\u002Fgenerative\u002Fcyclegan.ipynb) | [Code](https:\u002F\u002Fgithub.com\u002Ftensorflow\u002Fdocs\u002Fblob\u002Fmaster\u002Fsite\u002Fen\u002Ftutorials\u002Fgenerative\u002Fcyclegan.ipynb)\n\nTensorFlow Core pix2pix Tutorial: [Google Colab](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Ftensorflow\u002Fdocs\u002Fblob\u002Fmaster\u002Fsite\u002Fen\u002Ftutorials\u002Fgenerative\u002Fpix2pix.ipynb) | [Code](https:\u002F\u002Fgithub.com\u002Ftensorflow\u002Fdocs\u002Fblob\u002Fmaster\u002Fsite\u002Fen\u002Ftutorials\u002Fgenerative\u002Fpix2pix.ipynb)\n\nPyTorch Colab notebook: [CycleGAN](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fjunyanz\u002Fpytorch-CycleGAN-and-pix2pix\u002Fblob\u002Fmaster\u002FCycleGAN.ipynb) and [pix2pix](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002Fjunyanz\u002Fpytorch-CycleGAN-and-pix2pix\u002Fblob\u002Fmaster\u002Fpix2pix.ipynb)\n\nZeroCostDL4Mic Colab notebook: [CycleGAN](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002FHenriquesLab\u002FZeroCostDL4Mic\u002Fblob\u002Fmaster\u002FColab_notebooks_Beta\u002FCycleGAN_ZeroCostDL4Mic.ipynb) and [pix2pix](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002FHenriquesLab\u002FZeroCostDL4Mic\u002Fblob\u002Fmaster\u002FColab_notebooks_Beta\u002Fpix2pix_ZeroCostDL4Mic.ipynb)\n\n## Other implementations\n\n### CycleGAN\n\n\u003Cp>\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fleehomyc\u002Fcyclegan-1\"> [Tensorflow]\u003C\u002Fa> (by Harry Yang),\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Farchitrathore\u002FCycleGAN\u002F\">[Tensorflow]\u003C\u002Fa> (by Archit Rathore),\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fvanhuyz\u002FCycleGAN-TensorFlow\">[Tensorflow]\u003C\u002Fa> (by Van Huy),\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002FXHUJOY\u002FCycleGAN-tensorflow\">[Tensorflow]\u003C\u002Fa> (by Xiaowei Hu),\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002FLynnHo\u002FCycleGAN-Tensorflow-2\"> [Tensorflow2]\u003C\u002Fa> (by Zhenliang He),\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fluoxier\u002FCycleGAN_Tensorlayer\"> [TensorLayer1.0]\u003C\u002Fa> (by luoxier),\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Ftensorlayer\u002Fcyclegan\"> [TensorLayer2.0]\u003C\u002Fa> (by zsdonghao),\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002FAixile\u002Fchainer-cyclegan\">[Chainer]\u003C\u002Fa> (by Yanghua Jin),\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fyunjey\u002Fmnist-svhn-transfer\">[Minimal PyTorch]\u003C\u002Fa> (by yunjey),\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002FLdpe2G\u002FDeepLearningForFun\u002Ftree\u002Fmaster\u002FMxnet-Scala\u002FCycleGAN\">[Mxnet]\u003C\u002Fa> (by Ldpe2G),\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Ftjwei\u002FGANotebooks\">[lasagne\u002FKeras]\u003C\u002Fa> (by tjwei),\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fsimontomaskarlsson\u002FCycleGAN-Keras\">[Keras]\u003C\u002Fa> (by Simon Karlsson),\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002FLdpe2G\u002FDeepLearningForFun\u002Ftree\u002Fmaster\u002FOneflow-Python\u002FCycleGAN\">[OneFlow]\u003C\u002Fa> (by Ldpe2G)\n\u003C\u002Fp>\n\u003C\u002Ful>\n\n### pix2pix\n\n\u003Cp>\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Faffinelayer\u002Fpix2pix-tensorflow\"> [Tensorflow]\u003C\u002Fa> (by Christopher Hesse),\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002FEyyub\u002Ftensorflow-pix2pix\">[Tensorflow]\u003C\u002Fa> (by Eyyüb Sariu),\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdatitran\u002Fface2face-demo\"> [Tensorflow (face2face)]\u003C\u002Fa> (by Dat Tran),\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fawjuliani\u002FPix2Pix-Film\"> [Tensorflow (film)]\u003C\u002Fa> (by Arthur Juliani),\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fkaonashi-tyc\u002Fzi2zi\">[Tensorflow (zi2zi)]\u003C\u002Fa> (by Yuchen Tian),\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fpfnet-research\u002Fchainer-pix2pix\">[Chainer]\u003C\u002Fa> (by mattya),\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Ftjwei\u002FGANotebooks\">[tf\u002Ftorch\u002Fkeras\u002Flasagne]\u003C\u002Fa> (by tjwei),\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Ftaey16\u002Fpix2pixBEGAN.pytorch\">[Pytorch]\u003C\u002Fa> (by taey16)\n\u003C\u002Fp>\n\u003C\u002Ful>\n\n## Prerequisites\n\n- Linux or macOS\n- Python 3\n- CPU or NVIDIA GPU + CUDA CuDNN\n\n## Getting Started\n\n### Installation\n\n- Clone this repo:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fjunyanz\u002Fpytorch-CycleGAN-and-pix2pix\ncd pytorch-CycleGAN-and-pix2pix\n```\n\n- Install [PyTorch](http:\u002F\u002Fpytorch.org) and other dependencies. For Conda users, you can create a new Conda environment by\n\n```bash\nconda env create -f environment.yml\n```\n\nand then activate the environment by\n\n```bash\nconda activate pytorch-img2img\n```\n\n- For Docker users, we provide the pre-built Docker image and Dockerfile. Please refer to our [Docker](docs\u002Fdocker.md) page.\n- For Repl users, please click [![Run on Repl.it](https:\u002F\u002Frepl.it\u002Fbadge\u002Fgithub\u002Fjunyanz\u002Fpytorch-CycleGAN-and-pix2pix)](https:\u002F\u002Frepl.it\u002Fgithub\u002Fjunyanz\u002Fpytorch-CycleGAN-and-pix2pix).\n\n### CycleGAN train\u002Ftest\n\n- Download a CycleGAN dataset (e.g. maps):\n\n```bash\nbash .\u002Fdatasets\u002Fdownload_cyclegan_dataset.sh maps\n```\n\n- To log training progress and test images to W&B dashboard, set the `--use_wandb` flag with training script\n- Train a model:\n\n```bash\n#!.\u002Fscripts\u002Ftrain_cyclegan.sh\npython train.py --dataroot .\u002Fdatasets\u002Fmaps --name maps_cyclegan --model cycle_gan --use_wandb\n```\n\nTo see more intermediate results, check out `.\u002Fcheckpoints\u002Fmaps_cyclegan\u002Fweb\u002Findex.html`.\n\n- Test the model:\n\n```bash\n#!.\u002Fscripts\u002Ftest_cyclegan.sh\npython test.py --dataroot .\u002Fdatasets\u002Fmaps --name maps_cyclegan --model cycle_gan\n```\n\n- The test results will be saved to a html file here: `.\u002Fresults\u002Fmaps_cyclegan\u002Flatest_test\u002Findex.html`.\n\n### pix2pix train\u002Ftest\n\n- Download a pix2pix dataset (e.g.[facades](http:\u002F\u002Fcmp.felk.cvut.cz\u002F~tylecr1\u002Ffacade\u002F)):\n\n```bash\nbash .\u002Fdatasets\u002Fdownload_pix2pix_dataset.sh facades\n```\n\n- To log training progress and test images to W&B dashboard, set the `--use_wandb` flag with training script\n- Train a model:\n\n```bash\n#!.\u002Fscripts\u002Ftrain_pix2pix.sh\npython train.py --dataroot .\u002Fdatasets\u002Ffacades --name facades_pix2pix --model pix2pix --direction BtoA  --use_wandb\n```\n\nTo see more intermediate results, check out `.\u002Fcheckpoints\u002Ffacades_pix2pix\u002Fweb\u002Findex.html`.\n\n- Test the model (`bash .\u002Fscripts\u002Ftest_pix2pix.sh`):\n\n```bash\n#!.\u002Fscripts\u002Ftest_pix2pix.sh\npython test.py --dataroot .\u002Fdatasets\u002Ffacades --name facades_pix2pix --model pix2pix --direction BtoA\n```\n\n- The test results will be saved to a html file here: `.\u002Fresults\u002Ffacades_pix2pix\u002Ftest_latest\u002Findex.html`. You can find more scripts at `scripts` directory.\n- To train and test pix2pix-based colorization models, please add `--model colorization` and `--dataset_mode colorization`. See our training [tips](https:\u002F\u002Fgithub.com\u002Fjunyanz\u002Fpytorch-CycleGAN-and-pix2pix\u002Fblob\u002Fmaster\u002Fdocs\u002Ftips.md#notes-on-colorization) for more details.\n\n### Apply a pre-trained model (CycleGAN)\n\n- You can download a pretrained model (e.g. horse2zebra) with the following script:\n\n```bash\nbash .\u002Fscripts\u002Fdownload_cyclegan_model.sh horse2zebra\n```\n\n- The pretrained model is saved at `.\u002Fcheckpoints\u002F{name}_pretrained\u002Flatest_net_G.pth`. Check [here](https:\u002F\u002Fgithub.com\u002Fjunyanz\u002Fpytorch-CycleGAN-and-pix2pix\u002Fblob\u002Fmaster\u002Fscripts\u002Fdownload_cyclegan_model.sh#L3) for all the available CycleGAN models.\n- To test the model, you also need to download the horse2zebra dataset:\n\n```bash\nbash .\u002Fdatasets\u002Fdownload_cyclegan_dataset.sh horse2zebra\n```\n\n- Then generate the results using\n\n```bash\npython test.py --dataroot datasets\u002Fhorse2zebra\u002FtestA --name horse2zebra_pretrained --model test --no_dropout\n```\n\n- 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 `.\u002Fresults\u002F`. Use `--results_dir {directory_path_to_save_result}` to specify the results directory.\n\n- For pix2pix and your own models, you need to explicitly specify `--netG`, `--norm`, `--no_dropout` to match the generator architecture of the trained model. See this [FAQ](https:\u002F\u002Fgithub.com\u002Fjunyanz\u002Fpytorch-CycleGAN-and-pix2pix\u002Fblob\u002Fmaster\u002Fdocs\u002Fqa.md#runtimeerror-errors-in-loading-state_dict-812-671461-296) for more details.\n\n### Apply a pre-trained model (pix2pix)\n\nDownload a pre-trained model with `.\u002Fscripts\u002Fdownload_pix2pix_model.sh`.\n\n- Check [here](https:\u002F\u002Fgithub.com\u002Fjunyanz\u002Fpytorch-CycleGAN-and-pix2pix\u002Fblob\u002Fmaster\u002Fscripts\u002Fdownload_pix2pix_model.sh#L3) for all the available pix2pix models. For example, if you would like to download label2photo model on the Facades dataset,\n\n```bash\nbash .\u002Fscripts\u002Fdownload_pix2pix_model.sh facades_label2photo\n```\n\n- Download the pix2pix facades datasets:\n\n```bash\nbash .\u002Fdatasets\u002Fdownload_pix2pix_dataset.sh facades\n```\n\n- Then generate the results using\n\n```bash\npython test.py --dataroot .\u002Fdatasets\u002Ffacades\u002F --direction BtoA --model pix2pix --name facades_label2photo_pretrained\n```\n\n- Note that we specified `--direction BtoA` as Facades dataset's A to B direction is photos to labels.\n\n- If you would like to apply a pre-trained model to a collection of input images (rather than image pairs), please use `--model test` option. See `.\u002Fscripts\u002Ftest_single.sh` for how to apply a model to Facade label maps (stored in the directory `facades\u002FtestB`).\n\n- See a list of currently available models at `.\u002Fscripts\u002Fdownload_pix2pix_model.sh`\n\n### Multi-GPU training\n\nTo train a model on multiple GPUs, please use `torchrun --nproc_per_node=4 train.py ...` instead of `python train.py ...`. We also need to use synchronized batchnorm by setting `--norm sync_batch` (or `--norm sync_instance` for instance normgalization). The `--norm batch` is not compatible with DDP.\n\n## [Docker](docs\u002Fdocker.md)\n\nWe provide the pre-built Docker image and Dockerfile that can run this code repo. See [docker](docs\u002Fdocker.md).\n\n## [Datasets](docs\u002Fdatasets.md)\n\nDownload pix2pix\u002FCycleGAN datasets and create your own datasets.\n\n## [Training\u002FTest Tips](docs\u002Ftips.md)\n\nBest practice for training and testing your models.\n\n## [Frequently Asked Questions](docs\u002Fqa.md)\n\nBefore you post a new question, please first look at the above Q & A and existing GitHub issues.\n\n## Custom Model and Dataset\n\nIf you plan to implement custom models and dataset for your new applications, we provide a dataset [template](data\u002Ftemplate_dataset.py) and a model [template](models\u002Ftemplate_model.py) as a starting point.\n\n## [Code structure](docs\u002Foverview.md)\n\nTo help users better understand and use our code, we briefly overview the functionality and implementation of each package and each module.\n\n## Pull Request\n\nYou are always welcome to contribute to this repository by sending a [pull request](https:\u002F\u002Fhelp.github.com\u002Farticles\u002Fabout-pull-requests\u002F).\nPlease run `flake8 --ignore E501 .` and `pytest scripts\u002Ftest_before_push.py -v` before you commit the code. Please also update the code structure [overview](docs\u002Foverview.md) accordingly if you add or remove files.\n\n## Citation\n\nIf you use this code for your research, please cite our papers.\n\n```\n@inproceedings{CycleGAN2017,\n  title={Unpaired Image-to-Image Translation using Cycle-Consistent Adversarial Networks},\n  author={Zhu, Jun-Yan and Park, Taesung and Isola, Phillip and Efros, Alexei A},\n  booktitle={Computer Vision (ICCV), 2017 IEEE International Conference on},\n  year={2017}\n}\n\n\n@inproceedings{isola2017image,\n  title={Image-to-Image Translation with Conditional Adversarial Networks},\n  author={Isola, Phillip and Zhu, Jun-Yan and Zhou, Tinghui and Efros, Alexei A},\n  booktitle={Computer Vision and Pattern Recognition (CVPR), 2017 IEEE Conference on},\n  year={2017}\n}\n```\n\n## Other Languages\n\n[Spanish](docs\u002FREADME_es.md)\n\n## Related Projects\n\n[img2img-turbo](https:\u002F\u002Fgithub.com\u002FGaParmar\u002Fimg2img-turbo)\u003Cbr>\n[contrastive-unpaired-translation](https:\u002F\u002Fgithub.com\u002Ftaesungp\u002Fcontrastive-unpaired-translation) (CUT)\u003Cbr>\n[CycleGAN-Torch](https:\u002F\u002Fgithub.com\u002Fjunyanz\u002FCycleGAN) |\n[pix2pix-Torch](https:\u002F\u002Fgithub.com\u002Fphillipi\u002Fpix2pix) | [pix2pixHD](https:\u002F\u002Fgithub.com\u002FNVIDIA\u002Fpix2pixHD)|\n[BicycleGAN](https:\u002F\u002Fgithub.com\u002Fjunyanz\u002FBicycleGAN) | [vid2vid](https:\u002F\u002Ftcwang0509.github.io\u002Fvid2vid\u002F) | [SPADE\u002FGauGAN](https:\u002F\u002Fgithub.com\u002FNVlabs\u002FSPADE)\u003Cbr>\n[iGAN](https:\u002F\u002Fgithub.com\u002Fjunyanz\u002FiGAN) | [GAN Dissection](https:\u002F\u002Fgithub.com\u002FCSAILVision\u002FGANDissect) | [GAN Paint](http:\u002F\u002Fganpaint.io\u002F)\n\n## Cat Paper Collection\n\nIf you love cats, and love reading cool graphics, vision, and learning papers, please check out the Cat Paper [Collection](https:\u002F\u002Fgithub.com\u002Fjunyanz\u002FCatPapers).\n\n## Acknowledgments\n\nOur code is inspired by [pytorch-DCGAN](https:\u002F\u002Fgithub.com\u002Fpytorch\u002Fexamples\u002Ftree\u002Fmaster\u002Fdcgan).\n","该项目提供了基于PyTorch的CycleGAN和pix2pix图像到图像转换的实现。核心功能包括支持成对与不成对的图像转换，使用了生成对抗网络（GAN）技术来实现高质量的图像变换。项目最新版本已更新至支持Python 3.11及PyTorch 2.4，并且加入了分布式数据并行（DDP）以提高单机多GPU训练效率。此外，还引入了新的快速图像转换方法img2img-turbo，以及对比学习无配对翻译模型CUT，这些改进使得模型训练更快、更高效。适用于需要进行风格迁移、图像修复、色彩化等计算机视觉任务的场景，尤其是在缺乏大量成对训练数据的情况下。",2,"2026-06-11 02:49:01","top_language"]