{"id":13579147,"url":"https://github.com/nashory/pggan-pytorch","last_synced_at":"2025-04-12T23:30:45.178Z","repository":{"id":27001584,"uuid":"110502308","full_name":"nashory/pggan-pytorch","owner":"nashory","description":":fire::fire: PyTorch implementation of \"Progressive growing of GANs (PGGAN)\" :fire::fire:","archived":false,"fork":false,"pushed_at":"2022-11-22T02:05:22.000Z","size":101,"stargazers_count":823,"open_issues_count":37,"forks_count":136,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-04T02:09:40.072Z","etag":null,"topics":["celeba-hq-dataset","gan","generative-adversarial-network","progressive-gan","progressively-growing-gan","pytorch","tensorboard"],"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/nashory.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-11-13T05:01:40.000Z","updated_at":"2025-03-15T03:55:09.000Z","dependencies_parsed_at":"2023-01-14T05:46:53.483Z","dependency_job_id":null,"html_url":"https://github.com/nashory/pggan-pytorch","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/nashory%2Fpggan-pytorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nashory%2Fpggan-pytorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nashory%2Fpggan-pytorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nashory%2Fpggan-pytorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nashory","download_url":"https://codeload.github.com/nashory/pggan-pytorch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248647258,"owners_count":21139081,"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":["celeba-hq-dataset","gan","generative-adversarial-network","progressive-gan","progressively-growing-gan","pytorch","tensorboard"],"created_at":"2024-08-01T15:01:36.932Z","updated_at":"2025-04-12T23:30:45.154Z","avatar_url":"https://github.com/nashory.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"## Pytorch Implementation of \"Progressive growing GAN (PGGAN)\"\nPyTorch implementation of [PROGRESSIVE GROWING OF GANS FOR IMPROVED QUALITY, STABILITY, AND VARIATION](http://research.nvidia.com/sites/default/files/pubs/2017-10_Progressive-Growing-of//karras2017gan-paper.pdf)   \n__YOUR CONTRIBUTION IS INVALUABLE FOR THIS PROJECT :)__ \n\n![image](https://puu.sh/ydG0E/e0f32b0d92.png)\n\n## What's different from official paper?\n+ original: trans(G)--\u003etrans(D)--\u003estab / my code: trans(G)--\u003estab--\u003etransition(D)--\u003estab\n+ no use of NIN layer. The unnecessary layers (like low-resolution blocks) are automatically flushed out and grow.\n+ used torch.utils.weight_norm for to_rgb_layer of generator.\n+ No need to implement the the Celeb A data, Just come with your own dataset :)\n\n## How to use?\n__[step 1.] Prepare dataset__   \nThe author of progressive GAN released CelebA-HQ dataset, and which Nash is working on over on the branch that i forked this from. For my version just make sure that all images are the children of that folder that you declare in Config.py. Also i warn you that if you use multiple classes, they should be similar as to not end up with attrocities. \n\n~~~\n---------------------------------------------\nThe training data folder should look like : \n\u003ctrain_data_root\u003e\n                |--Your Folder\n                        |--image 1\n                        |--image 2\n                        |--image 3 ...\n---------------------------------------------\n~~~\n\n__[step 2.] Prepare environment using virtualenv__   \n  + you can easily set PyTorch (v0.3) and TensorFlow environment using virtualenv.\n  + CAUTION: if you have trouble installing PyTorch, install it mansually using pip. [[PyTorch Install]](http://pytorch.org/)\n  + For install please take your time and install all dependencies of PyTorch and also install tensorflow\n  \n  ~~~\n  $ virtualenv --python=python2.7 venv\n  $ . venv/bin/activate\n  $ pip install -r requirements.txt\n  $ conda install pytorch torchvision -c pytorch\n  ~~~\n\n\n\n__[step 3.] Run training__      \n+ edit `config.py` to change parameters. (don't forget to change path to training images)\n+ specify which gpu devices to be used, and change \"n_gpu\" option in `config.py` to support Multi-GPU training.\n+ run and enjoy!  \n\n~~~~\n  (example)\n  If using Single-GPU (device_id = 0):\n  $ vim config.py   --\u003e   change \"n_gpu=1\"\n  $ CUDA_VISIBLE_DEVICES=0 python trainer.py\n  \n  If using Multi-GPUs (device id = 1,3,7):\n  $ vim config.py   --\u003e   change \"n_gpu=3\"\n  $ CUDA_VISIBLE_DEVICES=1,3,7 python trainer.py\n~~~~\n \n  \n__[step 4.] Display on tensorboard__   (At the moment skip this part)\n+ you can check the results on tensorboard.\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://puu.sh/ympU0/c38f4e7d33.png\" width=\"700\"\u003e\u003c/p\u003e   \n\u003cp align=\"center\"\u003e\u003cimg src=\"https://puu.sh/ympUe/bf9b53dea8.png\" width=\"700\" align=\"center\"\u003e\u003c/p\u003e   \n\n  ~~~\n  $ tensorboard --logdir repo/tensorboard --port 8888\n  $ \u003chost_ip\u003e:8888 at your browser.\n  ~~~\n  \n  \n__[step 5.] Generate fake images using linear interpolation__   \n~~~\nCUDA_VISIBLE_DEVICES=0 python generate_interpolated.py\n~~~\n  \n  \n## Experimental results   \nThe result of higher resolution(larger than 256x256) will be updated soon.  \n\n__Generated Images__\n\n\u003cimg src=\"https://github.com/nashory/gifs/blob/pggan-pytorch/scatch_4.gif?raw=true\" width=\"430\" height=\"430\"\u003e \u003cimg src=\"https://puu.sh/yufIa/2a56d61890.jpg\" width=\"430\" height=\"430\"\u003e  \n\u003cimg src=\"https://github.com/nashory/gifs/blob/pggan-pytorch/4_8.gif?raw=true\" width=\"430\" height=\"430\"\u003e \u003cimg src=\"https://puu.sh/yufJx/a427ccdcdf.jpg\" width=\"430\" height=\"430\"\u003e  \n\u003cimg src=\"https://github.com/nashory/gifs/blob/pggan-pytorch/8_16.gif?raw=true\" width=\"430\" height=\"430\"\u003e \u003cimg src=\"https://puu.sh/yufMz/dd74f56d36.jpg\" width=\"430\" height=\"430\"\u003e  \n\u003cimg src=\"https://github.com/nashory/gifs/blob/pggan-pytorch/16_32.gif?raw=true\" width=\"430\" height=\"430\"\u003e \u003cimg src=\"https://puu.sh/yufLF/013cc59c15.jpg\" width=\"430\" height=\"430\"\u003e  \n\u003cimg src=\"https://github.com/nashory/gifs/blob/pggan-pytorch/32_64.gif?raw=true\" width=\"430\" height=\"430\"\u003e \u003cimg src=\"https://puu.sh/yufMV/835ec431ea.jpg\" width=\"430\" height=\"430\"\u003e  \n\u003cimg src=\"https://github.com/nashory/gifs/blob/pggan-pytorch/64_128.gif?raw=true\" width=\"430\" height=\"430\"\u003e \u003cimg src=\"https://puu.sh/yNT76/551760208c.jpg\" width=\"430\" height=\"430\"\u003e  \n\u003cimg src=\"https://github.com/nashory/gifs/blob/pggan-pytorch/128_256.gif?raw=true\" width=\"430\" height=\"430\"\u003e \u003cimg src=\"https://puu.sh/yNSS3/93a11066a7.jpg\" width=\"430\" height=\"430\"\u003e  \n\n\n__Loss Curve__\n\n![image](https://puu.sh/yuhi4/a49686b220.png)\n\n## To-Do List (will be implemented soon)\n- [ ] Support WGAN-GP loss\n- [ ] training resuming functionality.\n- [ ] loading CelebA-HQ dataset (for 512x512 and 1024x0124 training)\n\n\n## Compatability\n+ cuda v8.0 (if you dont have it dont worry)\n+ Tesla P40 (you may need more than 12GB Memory. If not, please adjust the batch_table in `dataloader.py`)\n\n\n## Acknowledgement\n+ [tkarras/progressive_growing_of_gans](https://github.com/tkarras/progressive_growing_of_gans)\n+ [nashory/progressive-growing-torch](https://github.com/nashory/progressive-growing-torch)\n+ [TuXiaokang/DCGAN.PyTorch](https://github.com/TuXiaokang/DCGAN.PyTorch)\n\n##\n## Author\nMinchulShin, [@nashory](https://github.com/nashory)  \n## Contributors\nDeMarcus Edwards, [@Djmcflush](https://github.com/Djmcflush)       \nMakeDirtyCode, [@MakeDirtyCode](https://github.com/MakeDirtyCode)      \nYuan Zhao, [@yuanzhaoYZ](https://github.com/yuanzhaoYZ)      \nzhanpengpan, [@szupzp](https://github.com/szupzp)       \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnashory%2Fpggan-pytorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnashory%2Fpggan-pytorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnashory%2Fpggan-pytorch/lists"}