{"id":13444441,"url":"https://github.com/eriklindernoren/Keras-GAN","last_synced_at":"2025-03-20T18:32:50.421Z","repository":{"id":38239568,"uuid":"96913967","full_name":"eriklindernoren/Keras-GAN","owner":"eriklindernoren","description":"Keras implementations of Generative Adversarial Networks.","archived":false,"fork":false,"pushed_at":"2022-12-12T05:55:51.000Z","size":90527,"stargazers_count":9181,"open_issues_count":144,"forks_count":3138,"subscribers_count":275,"default_branch":"master","last_synced_at":"2024-10-11T08:23:20.776Z","etag":null,"topics":["deep-learning","gan","generative-adversarial-networks","keras","neural-networks"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eriklindernoren.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-11T16:24:53.000Z","updated_at":"2024-10-10T12:47:04.000Z","dependencies_parsed_at":"2022-07-14T05:20:29.797Z","dependency_job_id":null,"html_url":"https://github.com/eriklindernoren/Keras-GAN","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eriklindernoren%2FKeras-GAN","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eriklindernoren%2FKeras-GAN/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eriklindernoren%2FKeras-GAN/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eriklindernoren%2FKeras-GAN/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eriklindernoren","download_url":"https://codeload.github.com/eriklindernoren/Keras-GAN/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221792892,"owners_count":16881289,"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":["deep-learning","gan","generative-adversarial-networks","keras","neural-networks"],"created_at":"2024-07-31T04:00:23.041Z","updated_at":"2024-10-28T06:31:02.033Z","avatar_url":"https://github.com/eriklindernoren.png","language":"Python","funding_links":[],"categories":["Code 💻","Uncategorized","Python","不同CV方向的优质内容汇总","4 生成对抗网络（GAN）","Examples/Notebooks","Here we go","🧰 Implementations of various types of GANs collection"],"sub_categories":["Uncategorized","2. Keras","Foundational model code (official / canonical)"],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"assets/keras_gan.png\" width=\"480\"\\\u003e\n\u003c/p\u003e\n\n**This repository has gone stale as I unfortunately do not have the time to maintain it anymore. If you would like to continue the development of it as a collaborator send me an email at eriklindernoren@gmail.com.**\n\n## Keras-GAN\nCollection of Keras implementations of Generative Adversarial Networks (GANs) suggested in research papers. These models are in some cases simplified versions of the ones ultimately described in the papers, but I have chosen to focus on getting the core ideas covered instead of getting every layer configuration right. Contributions and suggestions of GAN varieties to implement are very welcomed.\n\n\u003cb\u003eSee also:\u003c/b\u003e [PyTorch-GAN](https://github.com/eriklindernoren/PyTorch-GAN)\n\n## Table of Contents\n  * [Installation](#installation)\n  * [Implementations](#implementations)\n    + [Auxiliary Classifier GAN](#ac-gan)\n    + [Adversarial Autoencoder](#adversarial-autoencoder)\n    + [Bidirectional GAN](#bigan)\n    + [Boundary-Seeking GAN](#bgan)\n    + [Conditional GAN](#cgan)\n    + [Context-Conditional GAN](#cc-gan)\n    + [Context Encoder](#context-encoder)\n    + [Coupled GANs](#cogan)\n    + [CycleGAN](#cyclegan)\n    + [Deep Convolutional GAN](#dcgan)\n    + [DiscoGAN](#discogan)\n    + [DualGAN](#dualgan)\n    + [Generative Adversarial Network](#gan)\n    + [InfoGAN](#infogan)\n    + [LSGAN](#lsgan)\n    + [Pix2Pix](#pix2pix)\n    + [PixelDA](#pixelda)\n    + [Semi-Supervised GAN](#sgan)\n    + [Super-Resolution GAN](#srgan)\n    + [Wasserstein GAN](#wgan)\n    + [Wasserstein GAN GP](#wgan-gp)     \n\n## Installation\n    $ git clone https://github.com/eriklindernoren/Keras-GAN\n    $ cd Keras-GAN/\n    $ sudo pip3 install -r requirements.txt\n\n## Implementations   \n### AC-GAN\nImplementation of _Auxiliary Classifier Generative Adversarial Network_.\n\n[Code](acgan/acgan.py)\n\nPaper: https://arxiv.org/abs/1610.09585\n\n#### Example\n```\n$ cd acgan/\n$ python3 acgan.py\n```\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"http://eriklindernoren.se/images/acgan.gif\" width=\"640\"\\\u003e\n\u003c/p\u003e\n\n### Adversarial Autoencoder\nImplementation of _Adversarial Autoencoder_.\n\n[Code](aae/aae.py)\n\nPaper: https://arxiv.org/abs/1511.05644\n\n#### Example\n```\n$ cd aae/\n$ python3 aae.py\n```\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"http://eriklindernoren.se/images/aae.png\" width=\"640\"\\\u003e\n\u003c/p\u003e\n\n### BiGAN\nImplementation of _Bidirectional Generative Adversarial Network_.\n\n[Code](bigan/bigan.py)\n\nPaper: https://arxiv.org/abs/1605.09782\n\n#### Example\n```\n$ cd bigan/\n$ python3 bigan.py\n```\n\n### BGAN\nImplementation of _Boundary-Seeking Generative Adversarial Networks_.\n\n[Code](bgan/bgan.py)\n\nPaper: https://arxiv.org/abs/1702.08431\n\n#### Example\n```\n$ cd bgan/\n$ python3 bgan.py\n```\n\n### CC-GAN\nImplementation of _Semi-Supervised Learning with Context-Conditional Generative Adversarial Networks_.\n\n[Code](ccgan/ccgan.py)\n\nPaper: https://arxiv.org/abs/1611.06430\n\n#### Example\n```\n$ cd ccgan/\n$ python3 ccgan.py\n```\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"http://eriklindernoren.se/images/ccgan.png\" width=\"640\"\\\u003e\n\u003c/p\u003e\n\n### CGAN\nImplementation of _Conditional Generative Adversarial Nets_.\n\n[Code](cgan/cgan.py)\n\nPaper:https://arxiv.org/abs/1411.1784\n\n#### Example\n```\n$ cd cgan/\n$ python3 cgan.py\n```\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"http://eriklindernoren.se/images/cgan.gif\" width=\"640\"\\\u003e\n\u003c/p\u003e\n\n### Context Encoder\nImplementation of _Context Encoders: Feature Learning by Inpainting_.\n\n[Code](context_encoder/context_encoder.py)\n\nPaper: https://arxiv.org/abs/1604.07379\n\n#### Example\n```\n$ cd context_encoder/\n$ python3 context_encoder.py\n```\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"http://eriklindernoren.se/images/context_encoder.png\" width=\"640\"\\\u003e\n\u003c/p\u003e\n\n### CoGAN\nImplementation of _Coupled generative adversarial networks_.\n\n[Code](cogan/cogan.py)\n\nPaper: https://arxiv.org/abs/1606.07536\n\n#### Example\n```\n$ cd cogan/\n$ python3 cogan.py\n```\n\n### CycleGAN\nImplementation of _Unpaired Image-to-Image Translation using Cycle-Consistent Adversarial Networks_.\n\n[Code](cyclegan/cyclegan.py)\n\nPaper: https://arxiv.org/abs/1703.10593\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"http://eriklindernoren.se/images/cyclegan.png\" width=\"640\"\\\u003e\n\u003c/p\u003e\n\n#### Example\n```\n$ cd cyclegan/\n$ bash download_dataset.sh apple2orange\n$ python3 cyclegan.py\n```   \n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"http://eriklindernoren.se/images/cyclegan_gif.gif\" width=\"640\"\\\u003e\n\u003c/p\u003e\n\n\n### DCGAN\nImplementation of _Deep Convolutional Generative Adversarial Network_.\n\n[Code](dcgan/dcgan.py)\n\nPaper: https://arxiv.org/abs/1511.06434\n\n#### Example\n```\n$ cd dcgan/\n$ python3 dcgan.py\n```\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"http://eriklindernoren.se/images/dcgan2.png\" width=\"640\"\\\u003e\n\u003c/p\u003e\n\n### DiscoGAN\nImplementation of _Learning to Discover Cross-Domain Relations with Generative Adversarial Networks_.\n\n[Code](discogan/discogan.py)\n\nPaper: https://arxiv.org/abs/1703.05192\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"http://eriklindernoren.se/images/discogan_architecture.png\" width=\"640\"\\\u003e\n\u003c/p\u003e\n\n#### Example\n```\n$ cd discogan/\n$ bash download_dataset.sh edges2shoes\n$ python3 discogan.py\n```   \n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"http://eriklindernoren.se/images/discogan.png\" width=\"640\"\\\u003e\n\u003c/p\u003e\n\n### DualGAN\nImplementation of _DualGAN: Unsupervised Dual Learning for Image-to-Image Translation_.\n\n[Code](dualgan/dualgan.py)\n\nPaper: https://arxiv.org/abs/1704.02510\n\n#### Example\n```\n$ cd dualgan/\n$ python3 dualgan.py\n```\n\n### GAN\nImplementation of _Generative Adversarial Network_ with a MLP generator and discriminator.\n\n[Code](gan/gan.py)\n\nPaper: https://arxiv.org/abs/1406.2661\n\n#### Example\n```\n$ cd gan/\n$ python3 gan.py\n```\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"http://eriklindernoren.se/images/gan_mnist5.gif\" width=\"640\"\\\u003e\n\u003c/p\u003e\n\n### InfoGAN\nImplementation of _InfoGAN: Interpretable Representation Learning by Information Maximizing Generative Adversarial Nets_.\n\n[Code](infogan/infogan.py)\n\nPaper: https://arxiv.org/abs/1606.03657\n\n#### Example\n```\n$ cd infogan/\n$ python3 infogan.py\n```\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"http://eriklindernoren.se/images/infogan.png\" width=\"640\"\\\u003e\n\u003c/p\u003e\n\n### LSGAN\nImplementation of _Least Squares Generative Adversarial Networks_.\n\n[Code](lsgan/lsgan.py)\n\nPaper: https://arxiv.org/abs/1611.04076\n\n#### Example\n```\n$ cd lsgan/\n$ python3 lsgan.py\n```\n\n### Pix2Pix\nImplementation of _Image-to-Image Translation with Conditional Adversarial Networks_.\n\n[Code](pix2pix/pix2pix.py)\n\nPaper: https://arxiv.org/abs/1611.07004\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"http://eriklindernoren.se/images/pix2pix_architecture.png\" width=\"640\"\\\u003e\n\u003c/p\u003e\n\n#### Example\n```\n$ cd pix2pix/\n$ bash download_dataset.sh facades\n$ python3 pix2pix.py\n```   \n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"http://eriklindernoren.se/images/pix2pix2.png\" width=\"640\"\\\u003e\n\u003c/p\u003e\n\n### PixelDA\nImplementation of _Unsupervised Pixel-Level Domain Adaptation with Generative Adversarial Networks_.\n\n[Code](pixelda/pixelda.py)\n\nPaper: https://arxiv.org/abs/1612.05424\n\n#### MNIST to MNIST-M Classification\nTrains a classifier on MNIST images that are translated to resemble MNIST-M (by performing unsupervised image-to-image domain adaptation). This model is compared to the naive solution of training a classifier on MNIST and evaluating it on MNIST-M. The naive model manages a 55% classification accuracy on MNIST-M while the one trained during domain adaptation gets a 95% classification accuracy.\n\n```\n$ cd pixelda/\n$ python3 pixelda.py\n```\n\n| Method       | Accuracy  |\n| ------------ |:---------:|\n| Naive        | 55%       |\n| PixelDA      | 95%       |\n\n### SGAN\nImplementation of _Semi-Supervised Generative Adversarial Network_.\n\n[Code](sgan/sgan.py)\n\nPaper: https://arxiv.org/abs/1606.01583\n\n#### Example\n```\n$ cd sgan/\n$ python3 sgan.py\n```\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"http://eriklindernoren.se/images/sgan.png\" width=\"640\"\\\u003e\n\u003c/p\u003e\n\n### SRGAN\nImplementation of _Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network_.\n\n[Code](srgan/srgan.py)\n\nPaper: https://arxiv.org/abs/1609.04802\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"http://eriklindernoren.se/images/superresgan.png\" width=\"640\"\\\u003e\n\u003c/p\u003e\n\n\n#### Example\n```\n$ cd srgan/\n\u003cfollow steps at the top of srgan.py\u003e\n$ python3 srgan.py\n```\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"http://eriklindernoren.se/images/srgan.png\" width=\"640\"\\\u003e\n\u003c/p\u003e\n\n### WGAN\nImplementation of _Wasserstein GAN_ (with DCGAN generator and discriminator).\n\n[Code](wgan/wgan.py)\n\nPaper: https://arxiv.org/abs/1701.07875\n\n#### Example\n```\n$ cd wgan/\n$ python3 wgan.py\n```\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"http://eriklindernoren.se/images/wgan2.png\" width=\"640\"\\\u003e\n\u003c/p\u003e\n\n### WGAN GP\nImplementation of _Improved Training of Wasserstein GANs_.\n\n[Code](wgan_gp/wgan_gp.py)\n\nPaper: https://arxiv.org/abs/1704.00028\n\n#### Example\n```\n$ cd wgan_gp/\n$ python3 wgan_gp.py\n```\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"http://eriklindernoren.se/images/imp_wgan.gif\" width=\"640\"\\\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feriklindernoren%2FKeras-GAN","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feriklindernoren%2FKeras-GAN","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feriklindernoren%2FKeras-GAN/lists"}