RAD is a full-body realistic anonymization pipeline based on Stable Diffusion. Below are a few anonymization examples displayed as GIFs, and a visualization of RAD's architecture. We refer to the publication for more examples and details about the pipeline.
- Clone repository:
git clone git@github.com:viktorronnback/RAD.git realistic-anonymization
- Go to the root directory of the repository:
cd realistic-anonymization
- Create conda environment from yml file:
conda env create -f environment.yml
- Activate conda environment:
conda activate rad
- Install Facebook's segmentation model SAM by downloading a checkpoint:
wget https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth -P anonymizer/models/
Instructions for running a demo anonymization below.
- Go to anonymizer folder:
cd anonymizer
- Run anonymization using demo configuration file:
python main.py demo.yaml
- The anonymized images can be found in:
output/demo/final
.
This will automatically download models on the initial run (these can be large >10 GB).
Demo images in anonymizer/input/demo/ are stock-photos from pexels.com.
The anonymizer/template.config.yaml file provides a template for the supported configurations with corresponding default values.
The tool was originally created as part of a master thesis in Computer Science at Linköping University.
Link to thesis: RAD: Realistic Anonymization of Images using Stable Diffusion