deface is a free, open-source tool that uses an AI face detector to find every face in a video or photo and blur it for you, on your own PC. It's ideal for dashcam clips, holiday videos and anything else you want to share without showing strangers' faces. It runs from the command line, but you only need a handful of commands. On Python's own documentation for Windows, all checked on 1 December 2026. Always watch the output before you share it, because no detector catches every face.
What you need
A Windows 11, Linux or macOS PC. The README says deface supports "all commonly used operating systems", but it needs a command-line shell.
Python 3.8 or later (deface's PyPI listing requires at least 3.8).
Optionally, a graphics card for faster processing. deface can use Nvidia GPUs through CUDA, and other GPUs on Windows through DirectML.
deface only detects faces. If you also need number plates blurred, see our deface vs EgoBlur comparison.
Step 1: Install Python
On Windows, Python's documentation now points you to the Python install manager, which you can get from the Microsoft Store or from python.org/downloads (the docs say the two versions are identical). After installation, the python, py and pymanager commands should be available. If no Python runtime is installed yet, the docs tell you to use py install first. Run py help to see every command.
Step 2: Create a virtual environment
The deface README recommends installing it in its own virtual environment so its packages don't clash with anything else. Open Terminal (PowerShell) in a folder of your choice and run:
py -m venv deface-env
deface-env\Scripts\Activate.ps1
In Command Prompt, the second line is deface-env\Scripts\activate.bat instead. If PowerShell refuses to run the activation script, Python's docs say you may need to allow it for your user with Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser. Type deactivate when you've finished.
Step 3: Install deface
With the environment active, run:
python -m pip install deface
This installs only the packages deface strictly needs. That's enough to blur faces on your processor.
Step 4: Add GPU acceleration (optional)
deface can run its face detector through ONNX Runtime, which the README says "can significantly improve the overall processing speed" on a GPU. Install the package that matches your hardware:
Your hardware | Command from the deface README |
|---|
Nvidia GPU (CUDA) | python -m pip install onnx onnxruntime-gpu
|
AMD or Intel GPU on Windows (DirectML) | python -m pip install onnx onnxruntime-directml
|
CPU only (OpenVINO) | python -m pip install onnx onnxruntime-openvino
|
The README says OpenVINO can speed up CPU-only systems "by a few percent", and noted in July 2023 that it didn't yet work with Python 3.11. Since v1.4.0, deface automatically picks what it presumes is the fastest available execution provider. You can override that with --execution-provider. ONNX Runtime's documentation notes that DirectML is now in sustained engineering: it's still supported, but new work has moved to Windows ML. Our DirectML vs Windows ML explainer explains what that means.
Step 5: Blur your first video
Point deface at a video:
deface myvideos/vid1.mp4
It writes the result alongside the original as myvideos/vid1_anonymized.mp4. To process several files, list them separated by spaces, or pass a folder and deface will use every file in it. Photos work the same way.
Keep the sound: by default, deface discards all audio tracks. Add --keep-audio (or -k) to copy the audio into the new file.
Step 6: Fix missed faces and false positives
The setting that matters most is the detection threshold, --thresh (default 0.2). The README says to raise it if blur appears on things that aren't faces, and lower it if real faces are being missed. To find the right value, run a short clip with a low threshold and --draw-scores, which writes the detector's confidence score above each detection:
deface clip.mp4 --thresh 0.05 --draw-scores
Check the scores on the real faces and on any false hits, then pick a threshold between them for the final run. If blurs don't quite cover the edges of faces, increase --mask-scale (default 1.3).
deface analyses frames at full resolution by default. The README warns that this can cause performance problems on inputs well above 720p, and can even reduce accuracy, because the detector wasn't trained on ultra-high-resolution images. The fix is --scale, which shrinks frames only for detection. Your output keeps its original resolution. Keep the same aspect ratio as your video. For 16:9 footage:
deface dashcam.mp4 --scale 1280x720 --keep-audio
The README suggests 640x360 as a starting point and 1280x720 if the results at the lower resolution aren't good enough.
Step 8: Choose how faces are hidden
Option | Effect |
|---|
(default) | Strong Gaussian blur over an ellipse covering each face |
--boxes
| Use rectangles instead of ellipses |
--replacewith solid
| Solid black box |
--replacewith mosaic --mosaicsize 20
| Mosaic (pixelate). The size is in pixels, so increase it for high-resolution footage |
--replacewith img --replaceimg emoji.png
| Replace each face with your own image |
For example, deface photo.jpg --boxes --replacewith solid draws black boxes. You can also try deface live: deface cam opens a preview of your webcam with faces blurred.
Step 9: Check and tidy the output
deface looks at each frame independently, so a face the detector misses in a single frame can flash up for a moment. Step through busy scenes before you share the video. By default, deface encodes output with libx264. If the file comes out large, our guide to compressing videos with HandBrake can shrink it. For photos, remember that deface v1.5.0 keeps image metadata after blurring, so remove location data separately.
If you'd rather blur one face by hand in a graphical editor, or need something deface can't do, see our round-up of the best free AI face blurring software.