Skip to content

RAD: Realistic Anonymization of Images Using Stable Diffusion

License

Notifications You must be signed in to change notification settings

viktorronnback/RAD

Repository files navigation

RAD: Realistic Anonymization of Images Using Stable Diffusion

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.

anonymization-1 anonymization-2 anonymization-3 anonymization-4 anonymization-5

pipeline

Installation (Linux)

  1. Clone repository:
git clone git@github.com:viktorronnback/RAD.git realistic-anonymization
  1. Go to the root directory of the repository:
cd realistic-anonymization
  1. Create conda environment from yml file:
conda env create -f environment.yml
  1. Activate conda environment:
conda activate rad
  1. 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/

Run anonymization

Instructions for running a demo anonymization below.

  1. Go to anonymizer folder:
cd anonymizer
  1. Run anonymization using demo configuration file:
python main.py demo.yaml
  1. 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.

Configurations

The anonymizer/template.config.yaml file provides a template for the supported configurations with corresponding default values.

Publication

The tool was originally created as part of a master thesis in Computer Science at Linköping University.

Link to thesis (added after publication) - RAD: Realistic Anonymization of Images using Stable Diffusion

About

RAD: Realistic Anonymization of Images Using Stable Diffusion

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published