{"id":21216741,"url":"https://github.com/mingtaoguo/draggan_pytorch","last_synced_at":"2025-07-10T07:04:07.370Z","repository":{"id":168645682,"uuid":"644413926","full_name":"MingtaoGuo/DragGAN_pytorch","owner":"MingtaoGuo","description":"Unofficial implementation of DragGAN with StyleGAN2/3 pretrained models","archived":false,"fork":false,"pushed_at":"2023-05-26T11:07:10.000Z","size":161109,"stargazers_count":96,"open_issues_count":6,"forks_count":11,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-05T13:11:21.347Z","etag":null,"topics":["draggan","gans","image-editing","stylegan2","stylegan3"],"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/MingtaoGuo.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":"2023-05-23T13:18:22.000Z","updated_at":"2025-02-14T14:19:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"4a19c716-256f-4933-b3ad-f48dadfddf0c","html_url":"https://github.com/MingtaoGuo/DragGAN_pytorch","commit_stats":null,"previous_names":["mingtaoguo/draggan_stylegan3","mingtaoguo/draggan_pytorch"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MingtaoGuo/DragGAN_pytorch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MingtaoGuo%2FDragGAN_pytorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MingtaoGuo%2FDragGAN_pytorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MingtaoGuo%2FDragGAN_pytorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MingtaoGuo%2FDragGAN_pytorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MingtaoGuo","download_url":"https://codeload.github.com/MingtaoGuo/DragGAN_pytorch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MingtaoGuo%2FDragGAN_pytorch/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264545015,"owners_count":23625387,"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":["draggan","gans","image-editing","stylegan2","stylegan3"],"created_at":"2024-11-20T21:55:28.433Z","updated_at":"2025-07-10T07:04:07.355Z","avatar_url":"https://github.com/MingtaoGuo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DragGAN_stylegan3\nUnofficial implementation of DragGAN with StyleGAN2/3 pretrained models\n\n## Description   \n--------------\n\nThis repo is mainly to re-implement DragGAN based on stylegan2/3\n- DragGAN: [Drag Your GAN: Interactive Point-based Manipulation on the\nGenerative Image Manifold](https://vcai.mpi-inf.mpg.de/projects/DragGAN/)\n\n![](https://github.com/MingtaoGuo/DragGAN_stylegan3/blob/main/resources/intro.png)\n## Web Demo \nTrying out the Web Demo for dragging your own image: [![Hugging Face Spaces](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue)](https://huggingface.co/spaces/wuutiing2/DragGAN_pytorch)\n## Getting Started\n### Prerequisites\n- Linux or macOS\n- NVIDIA GPU + CUDA CuDNN\n- Python 3\n\n### Installation\n- Clone the repository:\n``` \ngit clone https://github.com/MingtaoGuo/DragGAN_stylegan3.git\ncd DragGAN_stylegan3\n```\n- Dependencies:  \nWe recommend running this repository using [Anaconda](https://docs.anaconda.com/anaconda/install/) or Docker. \nAll dependencies for defining the environment are provided in `environment.yaml` and `Dockerfile` .\n\n### Dragging\nDownloading the stylegan2 pretrained models:\n- [stylegan2-ffhq-512x512.pt](https://drive.google.com/file/d/1OFbkHKkBOtrskyDbOrgVfjoq2eKIiTMs/view?usp=share_link)\n- [stylegan2-afhqwild-512x512.pt](https://drive.google.com/file/d/1L4YN1iVC8urhW6EqCzJzJAa_Gz0_Ik7M/view?usp=share_link)\n- [stylegan2-afhqdog-512x512.pt](https://drive.google.com/file/d/1pRqs6AEHaAkPaz-YbgXMSCmswhGlKnrt/view?usp=share_link)\n- [stylegan2-afhqcat-512x512.pt](https://drive.google.com/file/d/1QUE-70ccfaJaYh890x-16lueoXc9y6V4/view?usp=share_link)\n- [stylegan2-human-1024x1024.pt](https://drive.google.com/file/d/1cK6KHH19iF09iMUg-iUDrl_TMIq8HGhC/view?usp=share_link)\n\nDrag generated image:\n``` \npython draggan_stylegan2.py\n```\nDrag generated human image:\n``` \npython draggan_stylegan2_human.py\n```\nDrag real image:\n``` \npython draggan_stylegan2_realimg.py\n```\nIn the `draggan_stylegan2.py`, `src_points (red point in image)` will be dragged to the `tar_points (blue point in image)`, so just revise the points in `src_points` and `tar_points`.\n# Results\n## Drag generated image\n|FFHQ1|FFHQ2|\n|-|-|\n|![](https://github.com/MingtaoGuo/DragGAN_pytorch/blob/main/resources/ffhq_400.gif)|![](https://github.com/MingtaoGuo/DragGAN_pytorch/blob/main/resources/ffhq_600.gif)|\n\n|Human1|Human2|\n|-|-|\n|![](https://github.com/MingtaoGuo/DragGAN_pytorch/blob/main/resources/human_100.gif)|![](https://github.com/MingtaoGuo/DragGAN_pytorch/blob/main/resources/human_600.gif)|\n\n|AFHQ1|AFHQ2|\n|-|-|\n|![](https://github.com/MingtaoGuo/DragGAN_pytorch/blob/main/resources/afhq_100.gif)|![](https://github.com/MingtaoGuo/DragGAN_pytorch/blob/main/resources/afhq_400.gif)|\n\n|AFHQ_Cat1|AFHQ_Cat2|\n|-|-|\n|![](https://github.com/MingtaoGuo/DragGAN_pytorch/blob/main/resources/afhq_cat_200.gif)|![](https://github.com/MingtaoGuo/DragGAN_pytorch/blob/main/resources/afhq_cat_800.gif)|\n\n|AFHQ_Dog1|AFHQ_Dog2|\n|-|-|\n|![](https://github.com/MingtaoGuo/DragGAN_pytorch/blob/main/resources/afhq_dog_200.gif)|![](https://github.com/MingtaoGuo/DragGAN_pytorch/blob/main/resources/afhq_dog_800.gif)|\n## Drag real image \n|Real image|Projected image|Drag Result|\n|-|-|-|\n|![](https://github.com/MingtaoGuo/DragGAN_pytorch/blob/main/resources/lion.png)|![](https://github.com/MingtaoGuo/DragGAN_pytorch/blob/main/resources/lion_proj.png)|![](https://github.com/MingtaoGuo/DragGAN_pytorch/blob/main/resources/afhq_lion_600.gif)|\n|![](https://github.com/MingtaoGuo/DragGAN_pytorch/blob/main/resources/ffhq_1.png)|![](https://github.com/MingtaoGuo/DragGAN_pytorch/blob/main/resources/ffhq_1_proj.png)|![](https://github.com/MingtaoGuo/DragGAN_pytorch/blob/main/resources/ffhq_1.gif)|\n\n## Author \nMingtao Guo\nE-mail: gmt798714378 at hotmail dot com\n## Acknowledgement\n[stylegan3](https://github.com/NVlabs/stylegan3)\n[stylegan-human](https://github.com/stylegan-human/StyleGAN-Human)\n[cutout team](https://www.cutout.pro/)\n## Reference\n[1]. Pan, Xingang, et al. \"Drag Your GAN: Interactive Point-based Manipulation on the Generative Image Manifold.\" arXiv preprint arXiv:2305.10973 (2023).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmingtaoguo%2Fdraggan_pytorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmingtaoguo%2Fdraggan_pytorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmingtaoguo%2Fdraggan_pytorch/lists"}