DeepPrivacy2 is a toolbox for realistic anonymization of humans, including a face and a full-body anonymizer.
DeepPrivacy first detects, then recursively anonymization all individuals in an image with a Generative Adversarial Network (GAN) that synthesizes one individual at a time.
This repository provide source code for the following papers
This repository improves over the original DeepPrivacy repository with the following new features:
We recommend to setup and install pytorch with anaconda following the pytorch installation instructions.
git clone https://github.com/hukkelas/deep_privacy2/
.setup.py
:
pip install -e .
or:
pip install git+https://github.com/hukkelas/deep_privacy2/
See the documentation for more installation instructions.
anonymize.py is the main script for anonymization.
Full-Body Anonymization
python3 anonymize.py configs/anonymizers/FB_cse.py -i media/regjeringen.jpg --output_path output.png --visualize
Face Anonymization
python3 anonymize.py configs/anonymizers/face.py -i media/regjeringen.jpg --output_path output.png --visualize
Webcam anonymization
python3 anonymize.py configs/anonymizers/FB_cse.py --webcam
See the documentation for more detailed instructions for anonymization.
The repository includes gradio demos to show of the capabilities of DeepPrivacy2.
Face anonymization. Test it on Hugging Face.
python3 -m gradio_demos.face
Full-body anonymization. Test it on Hugging Face.
python3 -m gradio_demos.body_cse
This repsitory is released under Apache 2.0 License, except for the following:.
sg3_torch_utils/
. This code is modified from github.com/NVlabs/stylegan2-ada-pytorch. Separate license is attached in the directory.dp2/detection/models/vit_pose
. This code is modified from https://github.com/gpastal24/ViTPose-Pytorch, where code is adapted from OpenMMLab. Original license is Apache 2-0.If you find this repository useful, please cite:
@inproceedings{hukkelas23DP2,
author={Hukkelås, Håkon and Lindseth, Frank},
booktitle={2023 IEEE/CVF Winter Conference on Applications of Computer Vision (WACV)},
title={DeepPrivacy2: Towards Realistic Full-Body Anonymization},
year={2023},
volume={},
number={},
pages={1329-1338},
doi={10.1109/WACV56688.2023.00138}}