A Flask-based web interface for Fawkes, the privacy-preserving tool that protects images against facial recognition systems.
Fawkes is a privacy tool that applies imperceptible modifications to images to protect them against unauthorized facial recognition systems. It "cloaks" faces in images, making them unrecognizable to facial recognition models while remaining visually unchanged to human observers.
This repo contains a web interface for just that, using Flask and gunicorn. The web interface provides an easy-to-use graphical interface for the Fawkes image cloaking system. Upload your images through a simple drag-and-drop interface and apply privacy-preserving modifications to protect against unauthorized facial recognition.
Tested on Python3.8.20 ("Why such old Python version?!" - Because the models that powers Fawkes was trained using tensorflow 2.4.1 back in 2019. Using up-to-date python requires up-to-date tensorflow, which requires a different structure of the underlying .h5 model. I'm about to figure this out)
git cloneing this repo requires git lfs (specifically, the .h5 file in ./fawkes/models/ is ~150MB), so make sure to sudo apt install git-lfs and verify installation success.
With git lfs installed, do the usual:
Keep in mind: Using a virtual environment is strongly advised.
Run the Flask application:
Or use the provided run script:
The server will start on http://localhost:5000
The app gets served using gunicorn, so you want to use a reverse-proxy like nginx and maybe a process manager.
- Upload an image: Drag and drop an image or click "Select Image"
- Choose cloaking mode:
- Low: Fastest, minimal protection (CPU/GPU)
- Mid: Balanced protection and speed (GPU required)
- High: Maximum protection, slower (GPU required)
- Start cloaking: Click "Start Cloaking" and monitor progress in the console
- Download: Once complete, download your cloaked image
- PNG
- JPEG/JPG
- GIF
- BMP
Maximum file size: 16MB
Fawkes adds pixel-level perturbations to images that are invisible to the human eye but cause facial recognition models to misidentify faces. These "cloaks" are specifically designed to:
- Remain imperceptible to humans
- Persist through image compression and social media uploads
- Protect against feature extraction by facial recognition systems
For more technical details, see the original Fawkes repository.
- Fastest processing
- Basic protection
- Works on CPU
- Recommended for quick tests
- Balanced protection
- Moderate processing time
- Requires GPU
- Good for general use
- Maximum protection
- Longest processing time
- Requires GPU
- Recommended for high-security needs
The application automatically detects GPU availability:
- With GPU: All three modes (Low, Mid, High) are available
- Without GPU: Only Low mode is available
To enable GPU support, ensure you have:
- CUDA-compatible GPU
- Appropriate CUDA drivers
- TensorFlow with GPU support: pip install tensorflow-gpu
Adhering to Fawke's principles of privacy, the app will purge every image from the server as soon as the cloaking is finished.
- Use GPU: Processing is significantly faster with GPU support
- Image size: Smaller images process faster; consider resizing large images
- Mode selection: Use Low mode for testing, High mode for final images
- Fawkes: Developed by Shawn Shan and the SANDLab at University of Chicago
- Original Paper: Fawkes: Protecting Privacy against Unauthorized Deep Face Recognition
This web interface is provided as-is. Please refer to the original Fawkes repository for licensing information regarding the Fawkes algorithm and implementation.
This tool is intended for privacy protection and educational purposes. Users are responsible for ensuring their use complies with applicable laws and regulations. The effectiveness of Fawkes may vary depending on the facial recognition system being protected against.
.png)



