{"id":13856972,"url":"https://github.com/xiaowei-hu/CycleGAN-tensorflow","last_synced_at":"2025-07-13T19:33:29.694Z","repository":{"id":173986772,"uuid":"88466785","full_name":"xiaowei-hu/CycleGAN-tensorflow","owner":"xiaowei-hu","description":"Tensorflow implementation for learning an image-to-image translation without input-output pairs. https://arxiv.org/pdf/1703.10593.pdf","archived":false,"fork":false,"pushed_at":"2019-06-12T14:13:25.000Z","size":12619,"stargazers_count":710,"open_issues_count":34,"forks_count":299,"subscribers_count":31,"default_branch":"master","last_synced_at":"2024-04-10T06:10:57.863Z","etag":null,"topics":["cyclegan","image-translation","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xiaowei-hu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-04-17T04:05:24.000Z","updated_at":"2024-03-25T02:03:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"60cd69c8-af4f-4c0f-86e0-b134abb3df43","html_url":"https://github.com/xiaowei-hu/CycleGAN-tensorflow","commit_stats":null,"previous_names":["xiaowei-hu/cyclegan-tensorflow"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaowei-hu%2FCycleGAN-tensorflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaowei-hu%2FCycleGAN-tensorflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaowei-hu%2FCycleGAN-tensorflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xiaowei-hu%2FCycleGAN-tensorflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xiaowei-hu","download_url":"https://codeload.github.com/xiaowei-hu/CycleGAN-tensorflow/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225912429,"owners_count":17544174,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cyclegan","image-translation","tensorflow"],"created_at":"2024-08-05T03:01:20.852Z","updated_at":"2024-11-22T14:31:31.883Z","avatar_url":"https://github.com/xiaowei-hu.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"\u003c!-- \u003cimg src='imgs/horse2zebra.gif' align=\"right\" width=384\u003e \n\n\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\n--\u003e\n# CycleGAN\n\nTensorflow implementation for learning an image-to-image translation **without** input-output pairs.\nThe method is proposed by [Jun-Yan Zhu](https://people.eecs.berkeley.edu/~junyanz/) in \n[Unpaired Image-to-Image Translation using Cycle-Consistent Adversarial Networkssee](https://arxiv.org/pdf/1703.10593.pdf). \nFor example in paper:\n\n\u003cimg src=\"imgs/teaser.jpg\" width=\"1000px\"/\u003e\n\n\u003c!--\n## Applications\n### Monet Paintings to Photos\n\u003cimg src=\"imgs/painting2photo.jpg\" width=\"1000px\"/\u003e\n\n### Collection Style Transfer\n\u003cimg src=\"imgs/photo2painting.jpg\" width=\"1000px\"/\u003e\n\n### Object Transfiguration\n\u003cimg src=\"imgs/objects.jpg\" width=\"1000px\"/\u003e\n\n### Season Transfer\n\u003cimg src=\"imgs/season.jpg\" width=\"1000px\"/\u003e\n\n### Photo Enhancement: iPhone photo to DSLR photo\n\u003cimg src=\"imgs/photo_enhancement.jpg\" width=\"1000px\"/\u003e\n\n--\u003e\n\n## Update Results\nThe results of this implementation:\n\n- Horses -\u003e Zebras \u003cbr\u003e\n\u003cimg src=\"imgs/n02381460_510.jpg\" width=\"200px\"/\u003e \u003cimg src=\"imgs/AtoB_n02381460_510.jpg\" width=\"200px\"/\u003e \u003cimg src=\"imgs/n02381460_4530.jpg\" width=\"200px\"/\u003e \u003cimg src=\"imgs/AtoB_n02381460_4530.jpg\" width=\"200px\"/\u003e \u003cimg src=\"imgs/n02381460_4660.jpg\" width=\"200px\"/\u003e \u003cimg src=\"imgs/AtoB_n02381460_4660.jpg\" width=\"200px\"/\u003e \u003cimg src=\"imgs/n02381460_8980.jpg\" width=\"200px\"/\u003e \u003cimg src=\"imgs/AtoB_n02381460_8980.jpg\" width=\"200px\"/\u003e\n\n- Zebras -\u003e Horses \u003cbr\u003e\n\u003cimg src=\"imgs/n02391049_1760.jpg\" width=\"200px\"/\u003e \u003cimg src=\"imgs/BtoA_n02391049_1760.jpg\" width=\"200px\"/\u003e \u003cimg src=\"imgs/n02391049_3070.jpg\" width=\"200px\"/\u003e \u003cimg src=\"imgs/BtoA_n02391049_3070.jpg\" width=\"200px\"/\u003e \u003cimg src=\"imgs/n02391049_5100.jpg\" width=\"200px\"/\u003e \u003cimg src=\"imgs/BtoA_n02391049_5100.jpg\" width=\"200px\"/\u003e \u003cimg src=\"imgs/n02391049_7150.jpg\" width=\"200px\"/\u003e \u003cimg src=\"imgs/BtoA_n02391049_7150.jpg\" width=\"200px\"/\u003e\n\nYou can download the pretrained model from [this url](https://1drv.ms/u/s!AroAdu0uts_gj5tA93GnwyfRpvBIDA)\nand extract the rar file to `./checkpoint/`.\n\n\n## Prerequisites\n- tensorflow r1.1\n- numpy 1.11.0\n- scipy 0.17.0\n- pillow 3.3.0\n\n## Getting Started\n### Installation\n- Install tensorflow from https://github.com/tensorflow/tensorflow\n- Clone this repo:\n```bash\ngit clone https://github.com/xhujoy/CycleGAN-tensorflow\ncd CycleGAN-tensorflow\n```\n\n### Train\n- Download a dataset (e.g. zebra and horse images from ImageNet):\n```bash\nbash ./download_dataset.sh horse2zebra\n```\n- Train a model:\n```bash\nCUDA_VISIBLE_DEVICES=0 python main.py --dataset_dir=horse2zebra\n```\n- Use tensorboard to visualize the training details:\n```bash\ntensorboard --logdir=./logs\n```\n\n### Test\n- Finally, test the model:\n```bash\nCUDA_VISIBLE_DEVICES=0 python main.py --dataset_dir=horse2zebra --phase=test --which_direction=AtoB\n```\n\n## Training and Test Details\nTo train a model,  \n```bash\nCUDA_VISIBLE_DEVICES=0 python main.py --dataset_dir=/path/to/data/ \n```\nModels are saved to `./checkpoints/` (can be changed by passing `--checkpoint_dir=your_dir`).  \n\nTo test the model,\n```bash\nCUDA_VISIBLE_DEVICES=0 python main.py --dataset_dir=/path/to/data/ --phase=test --which_direction=AtoB/BtoA\n```\n\n## Datasets\nDownload the datasets using the following script:\n```bash\nbash ./download_dataset.sh dataset_name\n```\n- `facades`: 400 images from the [CMP Facades dataset](http://cmp.felk.cvut.cz/~tylecr1/facade/).\n- `cityscapes`: 2975 images from the [Cityscapes training set](https://www.cityscapes-dataset.com/).\n- `maps`: 1096 training images scraped from Google Maps.\n- `horse2zebra`: 939 horse images and 1177 zebra images downloaded from [ImageNet](http://www.image-net.org/) using keywords `wild horse` and `zebra`.\n- `apple2orange`: 996 apple images and 1020 orange images downloaded from [ImageNet](http://www.image-net.org/) using keywords `apple` and `navel orange`.\n- `summer2winter_yosemite`: 1273 summer Yosemite images and 854 winter Yosemite images were downloaded using Flickr API. See more details in our paper.\n- `monet2photo`, `vangogh2photo`, `ukiyoe2photo`, `cezanne2photo`: The art images were downloaded from [Wikiart](https://www.wikiart.org/). The real photos are downloaded from Flickr using combination of tags *landscape* and *landscapephotography*. The training set size of each class is Monet:1074, Cezanne:584, Van Gogh:401, Ukiyo-e:1433, Photographs:6853.\n- `iphone2dslr_flower`: both classe of images were downlaoded from Flickr. The training set size of each class is iPhone:1813, DSLR:3316. See more details in our paper.\n\n\n## Reference\n- The torch implementation of CycleGAN, https://github.com/junyanz/CycleGAN\n- The tensorflow implementation of pix2pix, https://github.com/yenchenlin/pix2pix-tensorflow\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiaowei-hu%2FCycleGAN-tensorflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxiaowei-hu%2FCycleGAN-tensorflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxiaowei-hu%2FCycleGAN-tensorflow/lists"}