{"id":23080736,"url":"https://github.com/chen0040/keras-gan-models","last_synced_at":"2025-07-13T12:33:05.823Z","repository":{"id":85884604,"uuid":"115585361","full_name":"chen0040/keras-gan-models","owner":"chen0040","description":"Some generative adversarial network models that I studied","archived":false,"fork":false,"pushed_at":"2018-02-14T20:46:56.000Z","size":11450,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-03T23:51:10.454Z","etag":null,"topics":["content-generation","convolutional-neural-networks","gan","keras"],"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/chen0040.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-12-28T04:37:32.000Z","updated_at":"2021-01-17T12:44:27.000Z","dependencies_parsed_at":"2023-03-13T07:18:53.177Z","dependency_job_id":null,"html_url":"https://github.com/chen0040/keras-gan-models","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chen0040/keras-gan-models","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chen0040%2Fkeras-gan-models","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chen0040%2Fkeras-gan-models/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chen0040%2Fkeras-gan-models/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chen0040%2Fkeras-gan-models/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chen0040","download_url":"https://codeload.github.com/chen0040/keras-gan-models/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chen0040%2Fkeras-gan-models/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265139302,"owners_count":23717293,"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":["content-generation","convolutional-neural-networks","gan","keras"],"created_at":"2024-12-16T13:16:14.622Z","updated_at":"2025-07-13T12:33:05.814Z","avatar_url":"https://github.com/chen0040.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# keras-gan-models\n\nSome generative adversarial network models that I studied \n\n# Usage\n\n### Deep Convolution GAN\n\nBelow is the [sample codes](demo/dcgan_train.py) to train the DCGan on a set of sample images\n\n```python\nfrom keras_gan_models.library.dcgan import DCGan\nfrom keras_gan_models.library.utility.image_loader import load_and_scale_images\n\n\ndef main():\n    image_dir_path = './data/images'\n    model_dir_path = './models'\n\n    img_width = 32\n    img_height = 32\n    img_channels = 3\n\n    gan = DCGan()\n    gan.img_width = img_width\n    gan.img_height = img_height\n    gan.img_channels = img_channels\n    gan.random_input_dim = 200\n\n    images = load_and_scale_images(image_dir_path, '.png', img_width, img_height)\n\n    batch_size = 4\n    epochs = 2000\n    gan.fit(model_dir_path, images=images, batch_size=batch_size, epochs=epochs,\n            snapshot_dir_path='./data/outputs', snapshot_interval=100)\n\n\n\nif __name__ == '__main__':\n    main()\n```\n\nBelow is the [sample codes](demo/dcgan_generate.py) on how to load the trained DCGan model to generate\n3 new image samples:\n\n```python\nfrom keras_gan_models.library.dcgan import DCGan\n\n\ndef main():\n    model_dir_path = './models'\n\n    gan = DCGan()\n    gan.load_model(model_dir_path)\n\n    for i in range(3):\n        image = gan.generate_image()\n        image.save('./data/outputs/' + DCGan.model_name + '-generated-' + str(i) + '.png')\n```\n\n# Configure to run on GPU on Windows\n\n* Step 1: Change tensorflow to tensorflow-gpu in requirements.txt and install tensorflow-gpu\n* Step 2: Download and install the [CUDA® Toolkit 9.0](https://developer.nvidia.com/cuda-90-download-archive) (Please note that\ncurrently CUDA® Toolkit 9.1 is not yet supported by tensorflow, therefore you should download CUDA® Toolkit 9.0)\n* Step 3: Download and unzip the [cuDNN 7.4 for CUDA@ Toolkit 9.0](https://developer.nvidia.com/cudnn) and add the\nbin folder of the unzipped directory to the $PATH of your Windows environment ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchen0040%2Fkeras-gan-models","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchen0040%2Fkeras-gan-models","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchen0040%2Fkeras-gan-models/lists"}