{"id":19431282,"url":"https://github.com/zalandoresearch/spatial_gan","last_synced_at":"2025-07-11T22:06:03.798Z","repository":{"id":89615412,"uuid":"75093198","full_name":"zalandoresearch/spatial_gan","owner":"zalandoresearch","description":"Spatial Generative Adversarial Networks","archived":false,"fork":false,"pushed_at":"2020-09-17T07:40:37.000Z","size":37589,"stargazers_count":111,"open_issues_count":1,"forks_count":32,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-05-26T01:49:01.803Z","etag":null,"topics":["dcgan","gan","generative-adversarial-network","lasagne","machine-learning","python","theano"],"latest_commit_sha":null,"homepage":null,"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/zalandoresearch.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}},"created_at":"2016-11-29T15:13:32.000Z","updated_at":"2024-03-16T07:30:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"1c31ca4c-651a-4535-b4a6-ed90ef4e512f","html_url":"https://github.com/zalandoresearch/spatial_gan","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zalandoresearch/spatial_gan","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zalandoresearch%2Fspatial_gan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zalandoresearch%2Fspatial_gan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zalandoresearch%2Fspatial_gan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zalandoresearch%2Fspatial_gan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zalandoresearch","download_url":"https://codeload.github.com/zalandoresearch/spatial_gan/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zalandoresearch%2Fspatial_gan/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264904347,"owners_count":23681186,"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":["dcgan","gan","generative-adversarial-network","lasagne","machine-learning","python","theano"],"created_at":"2024-11-10T14:28:57.858Z","updated_at":"2025-07-11T22:06:03.790Z","avatar_url":"https://github.com/zalandoresearch.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spatial Generative Adversarial Networks\n\nCode is deprecated and not supported anymore. Please go to https://github.com/zalandoresearch/psgan for a newer version.\n\n##############\n\nThis code implements Spatial Generative Adversarial Networks (SGANs) on top of Lasagne/Theano, as published in the paper\n[https://arxiv.org/abs/1611.08207](https://arxiv.org/abs/1611.08207)\n\nThe code was tested on top of Lasagne (version 0.2.dev1) and Theano (0.9.0dev2).\n\n### Very Brief Model Description\nSGANs can generate sample textures of arbitrary size that look strikingly similar - but not exactly the same - compared to a single (or several) source image(s).\n- SGANs can be thought of as a convolutional roll-out of [Radford et al.'s](https://github.com/Newmu/dcgan_code) deep convolutional generative adversarial networks for texture synthesis\n- the fully convolutional nature allows for real-time generation of high resolution images\n- the method can fuse multiple source images and is highly scalable w.r.t. to output texture size and allows for generation of tiled textures\n\n\n### Examples\nYou can generate samples from a stored model. E.g. you can use the checked-in model:\n```\npython demo_generation.py models/barcac_filters64_npx257_5gL_5dL_epoch50.sgan\n```\nThis model was trained on a google maps image of barcelona, and yields a texture image like e.g. this\n\n![](samples/stored_models_barcac_filters64_npx257_5gL_5dL_epoch50.sgan.jpg)\n\nIt will also create a tilable periodic texture of the city, which is another capability of our SGAN model.\nYou can look at the script and tune how big textures you want to create, by changing the parameters NZ1 and NZ2. \n\n![](samples/TILE_models_barcac_filters64_npx257_5gL_5dL_epoch50.sgan_(256%2C%20256)_(2%2C%203).jpg)\n\n### Training the Model\nTo train the model on new images, edit the config.py file and set the texture_dir variable to a folder containing the image(s) you want to learn from. You might also want to change other parameters of the network there (e.g. depth, number of filters per layer etc...). Then run\n```\npython sgan.py\n```\nto train the model. Snapshots of the model will be stored in the subfolder models/ and samples after each epoch will be stored in samples/\n\n### Contact\n- Urs Bergmann    (ursbergmann@gmail.com)\n- Nikolay Jetchev (nikolay.jetchev@zalando.de)\n- Roland Vollgraf (roland.vollgraf@zalando.de)\n\n\n## License\nPlease make sure to cite/acknowledge our paper, if you use any of the conatained code in your own projects or publication:\nNikolay Jetchev, Urs Bergmann, and Roland Vollgraf. Texture synthesis with spatial generative adversarial networks. CoRR, abs/1611.08207, 2016.\n[https://arxiv.org/abs/1611.08207](https://arxiv.org/abs/1611.08207)\n\n\nThe MIT License (MIT)\n\nCopyright © 2016 Zalando SE, https://tech.zalando.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzalandoresearch%2Fspatial_gan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzalandoresearch%2Fspatial_gan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzalandoresearch%2Fspatial_gan/lists"}