Simple 2D face averaging with a clean CLI and an easy web UI. Processing runs 100% locally on your machine.
Example inputs (Human Faces dataset by Ashwin Gupta (Kaggle) — CC0: Public Domain):
Outputs by quality mode:
| Fast | Balanced | Max (BETA) |
|---|---|---|
![]() |
![]() |
![]() |
python apps/cli/run.py webOpen http://localhost:5000 and upload photos.
By default the web UI binds to 127.0.0.1 (localhost). To access it from another device on your LAN:
python apps/cli/run.py web --host 0.0.0.0Local processing notice: All image processing happens locally. Models are downloaded on first use and saved in models/ (hashes pinned in models/manifest.json). The web UI loads Google Fonts (you can replace them with local fonts if needed).
Stop the server: Press Ctrl+C in the terminal.
Note: Uses "max" quality mode by default. Enhancement libraries install with environment.yml.
python apps/cli/run.py run --examplesResult: runtime/outputs/
Before you begin, you need:
-
Conda (Miniconda or Anaconda)
- Download from https://docs.conda.io/en/latest/miniconda.html
- After installation, verify it works:
conda --version
- If you see a version number (e.g.,
conda 24.x.x), you're good!
-
Git (optional, but recommended)
- Download from https://git-scm.com/downloads
- Verify:
git --version
-
Python 3.11 (will be installed by Conda automatically)
Option A: Using Git (recommended)
git clone https://github.com/your-username/facer-avg.git
cd facer-avgOption B: Download ZIP
- Download the project as ZIP from GitHub
- Extract the ZIP file
- Open terminal/command prompt in the extracted folder
This creates an isolated Python environment with all required dependencies.
cd facer-avg
conda env create -f environment.ymlWhat this does:
- Creates a new environment named
avgface - Installs Python 3.11
- Installs all required packages (NumPy, OpenCV, MediaPipe, etc.)
You must activate the environment every time you want to use AvgFace.
conda activate avgfaceYou'll see (avgface) appear in your terminal prompt, indicating the environment is active.
Make sure everything is working:
python scripts/verify_setup.pyYou should see output like:
All dependencies installed.
✓✓✓✓✓ Setup verified successfully! ✓✓✓✓✓
If you see errors, check Troubleshooting.
python apps/cli/run.py webVisit http://localhost:5000 and:
- Drop images or select files
- Click "Use example photos" to test
- Download the averaged result
Stop the server: Press Ctrl+C in the terminal.
Quality Modes:
fast: Quick preview, no enhancement libraries usedbalanced: Restoration enabled (requires enhancement libraries)max: Restoration + upscaling (requires enhancement libraries, default)
- 4-Step Workflow: Add photos → Tune output → Process → Download
- Sticky Header: Step indicator stays visible while scrolling
- Progress Tracking: Real-time progress bar and live logs
- Keyboard Shortcuts: Press
?to view available shortcuts - Tooltips & Hints: Helpful guidance below each action
- Responsive Design: Works on desktop and mobile
python apps/cli/run.py run --faces <path> # Average faces from folder
python apps/cli/run.py run --examples # Use bundled example set
python apps/cli/run.py run --faces <path> --quality max --size 1600x2200Options:
| Flag | Values | Default | Description |
|---|---|---|---|
--faces |
path | - | Folder with images (JPG/PNG) |
--examples |
- | - | Use data/examples/faces_example/ |
--quality |
fast, balanced, max |
max |
Speed vs quality |
--size |
WIDTHxHEIGHT |
preset | Output resolution |
--background |
gray, white, black |
gray |
Background color |
Quality Modes:
fast: Quick preview, no enhancement libraries usedbalanced: Restoration enabled (requires enhancement libraries)max: Restoration + upscaling (requires enhancement libraries, default)
- Fast & deterministic: 2D pipeline runs locally
- Two interfaces: CLI command line + web UI
- Private: No uploads, no third-party servers
See THIRD_PARTY_NOTICES.md for dataset, model, and library credits.
See CONTRIBUTING.md and CODE_OF_CONDUCT.md.
- Quality options: Fast preview to max quality with upscaling
- High-quality defaults: Max quality with restoration + upscaling out of the box
facer-avg/
├── apps/
│ ├── cli/run.py # CLI entrypoint
│ ├── web/app.py # Web server
│ └── web/templates/ # Web UI (HTML, CSS, JS)
├── src/
│ ├── average_best.py # Main averaging pipeline
│ └── utils/ # Helper modules
├── data/
│ ├── faces/ # Your input images (gitignored)
│ └── examples/ # Sample faces
├── runtime/outputs/ # Results (gitignored)
└── docs/ # Detailed docs
MIT



