Skip to content

TrustMLRG/MASQUE

Repository files navigation

Controllable Adversarial Makeup for Privacy via Text-guided Diffusion

MASQUE is a diffusion-based system that applies text-guided, localized makeup edits designed to fool facial recognition models. It hides identities effectively while keeping the images realistic, supporting a wide variety of makeup styles, and staying reliable even under common image transformations.

1. Build Environment

Create and activate the conda environment:

conda env create -f requirement.yaml
conda activate masque

2. Download Face Recognition Models

Download from: Google Drive
Place the downloaded files inside the models/ folder.


3. Download Face Parsing Model

Download from: Google Drive
Place the file inside the models/ folder.


4. Running

You can run in batch mode or single-image mode.

Batch Mode

Prepare a JSON file (ref_map_json) that maps identities to source and reference image basenames.

python run.py \
  --mode batch \
  --source_prompt "A face of a human" \
  --target_prompt "A face of a human with red lipstick" \
  --target_word red \
  --images_dir src_dir \
  --img_ext jpg \
  --result_dir ./results/batch1 \
  --skip_existing \
  --ref_map_json identity.json \
  --ref_base_dir ref_dir

Single Image Mode

python run.py \
  --mode single \
  --source_prompt "A face of a human" \
  --target_prompt "A face of a human with red lipstick" \
  --target_word red \
  --img_path /path/to/imgs/0001.jpg \
  --result_dir ./results/run1

About

A Diffusion-Based Framework for AFR

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages