{"id":31177754,"url":"https://github.com/parham1998/face-anonymization","last_synced_at":"2026-04-18T10:34:57.766Z","repository":{"id":315414592,"uuid":"1052674541","full_name":"parham1998/Face-Anonymization","owner":"parham1998","description":"Official Implementation of the Paper \"Controllable Localized Face Anonymization via Diffusion Inpainting\"","archived":false,"fork":false,"pushed_at":"2025-09-18T12:51:36.000Z","size":3771,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-18T13:47:11.827Z","etag":null,"topics":["controllable-anonymization","diffusion-inpainting","diffusion-models","face-anonymization","localized-anonymization","stable-diffusion"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/parham1998.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-08T11:46:54.000Z","updated_at":"2025-09-18T12:58:43.000Z","dependencies_parsed_at":"2025-09-18T13:47:22.106Z","dependency_job_id":"195df0bf-2ee7-4d70-a6b7-c67528fb6f89","html_url":"https://github.com/parham1998/Face-Anonymization","commit_stats":null,"previous_names":["parham1998/face-anonymization"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/parham1998/Face-Anonymization","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parham1998%2FFace-Anonymization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parham1998%2FFace-Anonymization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parham1998%2FFace-Anonymization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parham1998%2FFace-Anonymization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parham1998","download_url":"https://codeload.github.com/parham1998/Face-Anonymization/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parham1998%2FFace-Anonymization/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275951151,"owners_count":25558395,"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","status":"online","status_checked_at":"2025-09-19T02:00:09.700Z","response_time":108,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["controllable-anonymization","diffusion-inpainting","diffusion-models","face-anonymization","localized-anonymization","stable-diffusion"],"created_at":"2025-09-19T14:07:39.884Z","updated_at":"2026-04-18T10:34:57.758Z","avatar_url":"https://github.com/parham1998.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \tControllable Localized Face Anonymization via Diffusion Inpainting (ICASSP 2026) [[ArXiv](http://arxiv.org/abs/2509.14866)] \n\n\u003cp align=\"center\"\u003e\n \u003ca href=\"https://parham1998.github.io/\" target=\"_blank\"\u003eAli Salar\u003c/a\u003e,\n \u003ca href=\"https://sites.google.com/site/qingliucs/home\" target=\"_blank\"\u003eQing Liu\u003c/a\u003e,\n \u003ca href=\"https://gyzhao-nm.github.io/Guoying/\" target=\"_blank\"\u003eGuoying Zhao\u003c/a\u003e\n \u003cbr\u003e\n\u003c/p\u003e\n\n## Abstract\n\u003cp align=\"justify\"\u003e The growing use of portrait images in computer vision highlights the need to protect personal identities. At the same time, anonymized images must remain useful for downstream computer vision tasks. In this work, we propose a unified framework that leverages the inpainting ability of latent diffusion models to generate realistic anonymized images. Unlike prior approaches, we have complete control over the anonymization process by designing an adaptive attribute-guidance module that applies gradient correction during the reverse denoising process, aligning the facial attributes of the generated image with those of the synthesized target image. Our framework also supports localized anonymization, allowing users to specify which facial regions are left unchanged. Extensive experiments conducted on the public CelebA-HQ and FFHQ datasets show that our method outperforms state-of-the-art approaches while requiring no additional model training. \u003c/p\u003e\n\n## Setup\n- **Get code**\n```shell \ngit clone https://github.com/parham1998/Face-Anonymization.git\n```\n\n- **Build environment**\n```shell\ncd Face-Anonymization\n# use anaconda to build environment \nconda create -n Face-Anonymization python=3.11.7\nconda activate Face-Anonymization\n# install packages\npip install -r requirements.txt\n```\n\n- **Download assets and place them in the assets folder**\n  - Download datasets from [Datasets](https://drive.google.com/drive/folders/1D87bLfBm6PEvdi7DV2mahaIqUWtScmCb?usp=sharing)\n  - Download pre-trained face parsing model from [Face_Parsing](https://github.com/TracelessLe/FaceParsing.PyTorch)\n  - Download pre-trained facenet model from [AMT-GAN](https://github.com/CGCL-codes/AMT-GAN)\n  - Download pre-trained FaRL from [FaRL](https://github.com/FacePerceiver/FaRL)\n  - Download pre-trained LDM from [LDM](https://huggingface.co/stabilityai/stable-diffusion-2-inpainting/blob/main/512-inpainting-ema.ckpt)\n\n- **The final assets folder should be like this:**\n```shell\nassets\n  └- datasets\n    └- CelebA-HQ\n    └- FFHQ\n  └- face_parsing\n    └- 38_G.pth\n  └- face_recognition_models\n    └- facenet.pth\n    └- facenet.py\n  └- farl\n    └- FaRL-Base-Patch16-LAIONFace20M-ep16.pth\n    └- FaRL-Base-Patch16-LAIONFace20M-ep64.pth\n  └- ldm\n    └- 512-inpainting-ema.ckpt\n  └- target_images\n```\n\n- **[Datasets](https://drive.google.com/drive/folders/1D87bLfBm6PEvdi7DV2mahaIqUWtScmCb?usp=sharing) are already aligned. However, for new data, the images should be aligned before starting the anonymization process:**\n```shell\npython align.py\n```\n\n- **For anonymization:**\n```shell\nsource_dir=source images folder path\ntarget_path=the desired synthesized target image path\nMTCNN_cropping=True\nexcluded_masks=choose number from: {'2: nose', '3: eye_glasses', '4: l_eye', '5: r_eye', '6: l_brow', '7:r_brow', '10: mouth', '11: u_lip', '12: l_lip'}\n```\n\n5. Run the code:\n```shell\npython main.py\n```\n\n## Citation \n```bibtex\n```\n\n## Acknowledgments\nOur code structure is based on [stablediffusion](https://github.com/Stability-AI/stablediffusion/tree/main)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparham1998%2Fface-anonymization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparham1998%2Fface-anonymization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparham1998%2Fface-anonymization/lists"}