Download it from Releases.
It:
- works completely on-device, so no information is ever uploaded to any server, and it works completely offline
- uses a state-of-the-art face detection model called RetinaFace, so it works pretty well. picks up on faces even when turned, masked, etc.
- runs on ONNX Runtime with WebAssembly backend, with an HTML/vanilla JS frontend via Tauri, so it's also really fast + lightweight
- born out of the need to blur faces when publishing photos of protests, especially Palestine solidarity protests after Oct. 7, 2023.
All source code for the released version of this app is in p3-onnx-full. It's a desktop app made using Tauri + Tailwind + HTML/vanilla JS.
To setup:
- install Rust
- install Node/NPM
- cd to
p3-onnx-full. runnpm ito install packages - run
npm run twto get Tailwind to update/public/style.cssbased on utility classes - run
npm run tauri devfor dev
To make changes:
- edit
index.htmlandcontroller.jsin/publicfor app changes,facedetect.jsfor inference / pre/post-processing changes. If running Tauri in dev mode, it should hot refresh. If edit JS files, may need to refresh WebView manually to see changes
To build:
- run
npm run tauri build - to code sign on Mac OS (make bundle runable on other computers), follow Tauri docs to create and install a certificate, then define the following environment variables (
export VARIABLE=VALUEin terminal):APPLE_CERTIFICATE_PASSWORDAPPLE_SIGNING_IDENTITYAPPLE_IDAPPLE_PASSWORDAPPLE_TEAM_ID- For CI (ex. GitHub actions) you also need
APPLE_CERTIFICATE, a base64 string of the certificate (see docs linked above). If you install the certificate on your computer, you don't need this variable, the builder will find the certificate using the signing identity.
(misc. notes, docs for previous prototypes)
There are several other prototype versions currently in the repository
- P0: initial tests with Python scripts. MVP using RetinaFace
- P1: functional but suboptimal (330 mb bundle, a bit slow) Python Eel desktop app, using RetinaFace
- P2: onnxruntime-web prototype with straightforward HTML/CSS/JS, using UltraFace (modified RetinaFace)
- P3: onnxruntime-web and Tauri
2023-12-27: Tried Neutralino but had some bundling issues, and Tauri APIs were really useful anyways.
2023-12-26: used https://github.com/microsoft/onnxruntime/blob/main/tools/python/remove_initializer_from_input.py on UltraFace .onnx file per microsoft/onnxruntime#4033 to get rid of a bunch of error messages. There were 244 before. 35 remain.
Use npm light-server instead of http-server. cd to p2-onnx and run light-server -s ., then visit the address in browser. Open console for debug info.
Make venv then install packages with pip install -r requirements.txt. Update with pip freeze > requirements.txt
Build commands, per Eel instructions -- cd to eel folder and then build with the following:
- Windows:
python -m eel main.py web --noconsole --onefile --icon icons/icon.ico -n Blurryface. - Mac: tbd, it needs a different icon format
12/20/2023: bottle v0.12.25 seems to cause problems with the Pyinstaller Windows build. Per this StackOverflow thread I manually replaced bottle.py in my AppData Scripts and site-packages folders with the v0.13-dev version of the file in the bottle.py repository.
objectives/constraints
- must work offline and on-device, be reasonably fast on a reasonable laptop
- must recognize faces that are masked, hooded, glasses on, otherwise partially obscured
- eventually: create GUI that's easy for anyone on Mac OS and Windows to use (mobile eventually?)
dev notes
- opencv default face detection filter tested -- not great
- face-recognition tested. it was okay but this package doesn't expose a lot of parameters
- RetinaFace worked really well. Found via DeepFace. Part of InsightFace
- sensitive-test-images folder has real-world sensitive images that this tool would be used on. hidden in .gitignore

