Install
$ agentstack add mcp-yhyatt-dmaf β scanned Β· β verified β works with Claude Code, Cursor, and more.
Security review
β PassedNo issues found. Passed automated security review. Β· v0.1.0 How review works β
- β Prompt-injection patterns
- β Secret / credential exfiltration
- β Dangerous shell & filesystem operations
- β Untrusted network calls
- β Known-malicious package signatures
What it can access
- β Network access No
- β Filesystem access No
- β Shell / process execution No
- β Environment & secrets No
- β Dynamic code execution No
From automated source analysis of v0.1.0. βUsedβ means the capability is present in the source β more access means more to trust, not that itβs unsafe.
About
π¦ DMAF Don't Miss A Face
Automated WhatsApp photo & video backup with intelligent face recognition
Never miss a moment with your loved ones β DMAF watches your WhatsApp groups, recognizes the faces you care about in photos and videos, and backs them up to Google Photos automatically. Set it up once. After that: zero LLM tokens, minimal cloud costs, fully autonomous.
[](https://github.com/yhyatt/DMAF/actions/workflows/ci.yml) [](https://github.com/yhyatt/DMAF/blob/main/LICENSE) [](https://github.com/yhyatt/DMAF) [](https://clawhub.ai/skills/dmaf) [](https://github.com/yhyatt/DMAF/blob/main/CONTRIBUTING.md)
OpenClaw π¦ β’ Features β’ Quick Start β’ How It Works β’ Configuration β’ Backends β’ Contributing
π¦ OpenClaw Friendly
DMAF is designed to be set up and operated entirely by an AI agent. If you use OpenClaw, you can go from zero to a working pipeline with a single prompt.
Install the DMAF skill from ClaWHub (or copy [deploy/openclaw-skill/](deploy/openclaw-skill/) to your skills directory), then just say:
> "Set up DMAF for me. My GCP project ID is [your-project] and my WhatsApp is already connected to OpenClaw."
Your agent will walk through the full setup: GCP project, service account, GCS buckets, reference photos, config, the media sync cron, and the Cloud Scheduler β reading [deploy/setup-secrets.md](deploy/setup-secrets.md) as its guide.
> π‘ After setup: zero LLM tokens. The ongoing pipeline is a system cron + Cloud Run job β pure infrastructure, no AI calls, no ongoing API cost.
Also friendly for:
- π€ Coding agents (Claude Code, Copilot, Cursor) β [
AGENTS.md](AGENTS.md) gives full architecture context, test patterns, and common pitfalls - π¦Ύ MCP clients (Claude Desktop, Claude Code, Cursor, Windsurf) β install the [MCP server](deploy/mcp-setup.md) and your AI can
trigger_scan(),get_status(),add_person()and more β no gcloud knowledge needed
β¨ Features
π Smart Face Recognition
- Three powerful backends:
dlib(CPU-optimized),InsightFace(non-commercial), orAuraFace(Apache 2.0, commercial use OK) - Photos & video clips: Scans both images and WhatsApp video clips β stops on first match, uploads the full clip
- Multi-face detection: Handles group photos and videos with multiple faces
- Configurable tolerance: Fine-tune matching sensitivity per deployment
- Advanced detection thresholds: Separate thresholds for training vs. production
π¦ OpenClaw Friendly
- One-prompt setup: Install the DMAF skill, describe your setup, done
- WhatsApp media capture: OpenClaw intercepts group photos & videos automatically β no desktop app, no Android required
- Token-free after setup: The sync cron and Cloud Run pipeline run with zero LLM calls β only minimal GCP infrastructure costs (Cloud Run + GCS, free-tier eligible)
- Zero-maintenance sync: System cron uploads media to GCS every 30 min, no agent involvement
- Agent-operable: Trigger scans, view logs, add people β all via shell/gcloud commands any agent can run
- π€ Developer friendly:
AGENTS.mdwith architecture, mocks, pitfalls, CI rules - π¦Ύ Agentic friendly: API-first pipeline, gcloud-scriptable end to end
π Auto-Refresh Training
- Intelligent updates: Automatically adds high-quality matched frames to known_people every 60 days
- Smart selection: Picks moderately challenging images (score β 0.65) for best training signal
- Face cropping: Extracts and saves padded face crops
- Email notifications: Get notified when training images are added
βοΈ Google Photos Integration
- Automatic uploads: Photos and full video clips backed up seamlessly
- Album organization: Upload to a named album (recommended β keeps face-matched photos separate from your native camera-roll backup)
- OAuth2 authentication: Secure, offline token-based access
- Cloud staging support: Delete source files after upload (ideal for GCS pipelines)
β‘ Efficient & Token-Free
- Zero LLM tokens after setup: The entire pipeline β sync cron, face recognition, upload β runs without any AI calls
- Two-layer deduplication: Path-based dedup (fast Firestore lookup) + content SHA-256 dedup β the same photo arriving via multiple WhatsApp groups is only processed and uploaded once; survives container restarts
- Video early exit: Sampling stops the moment a known face is found β no wasted compute
- Intelligent retry logic: Exponential backoff for network resilience
- Scale-to-zero: Cloud Run Job β no cost when idle, GCP free tier eligible
π§ Observability & Monitoring
- Email alerts: SMTP notifications for errors and borderline recognitions
- Score tracking: Records similarity scores (0.0β1.0) for every match
- Configurable timezone: Alert emails show timestamps in your local time (IANA timezone)
- Batched notifications: Hourly digest prevents inbox spam
- Event retention: 90-day history with automatic cleanup
π Quick Start
π¦ Have OpenClaw? One prompt away
- Install the DMAF skill:
clawhub install dmafβ or browse it at clawhub.ai/skills/dmaf - Make sure your WhatsApp channel is linked in OpenClaw
- Say to your agent:
Set up DMAF for me. My GCP project ID is [your-project-id] and my WhatsApp
is already connected to OpenClaw. Walk me through everything.
Your agent reads [deploy/setup-secrets.md](deploy/setup-secrets.md) and [deploy/openclaw-integration.md](deploy/openclaw-integration.md) to guide you step by step.
> β Zero ongoing tokens. Once setup is done, DMAF runs entirely on a system cron + Cloud Run β no LLM involved, no AI API costs β only the minimal GCP infrastructure you already pay for.
π οΈ Manual Setup
Prerequisites
- Python 3.10 or higher
- Google Cloud project with Photos Library API enabled
- WhatsApp media access via one of:
- OpenClaw integration (iPhone/Android) β β Recommended, see [
deploy/openclaw-integration.md](deploy/openclaw-integration.md) - WhatsApp Desktop + rclone β Cross-platform
- Android direct sync β FolderSync Pro, Syncthing
Installation
git clone https://github.com/yhyatt/DMAF.git
cd DMAF
python -m venv .venv && source .venv/bin/activate
# Choose your face recognition backend:
pip install -e ".[auraface]" # β Apache 2.0 β commercial OK, zero false positives
pip install -e ".[insightface]" # High accuracy, non-commercial only
pip install -e ".[face-recognition]" # CPU-optimized, easiest setup
Setup
- Add reference photos of the people to recognize:
`` data/known_people/ βββ Alice/ β βββ photo1.jpg β βββ photo2.jpg βββ Bob/ βββ photo1.jpg ``
- Configure:
``bash cp config.example.yaml config.yaml # Edit config.yaml β set watch_dirs and recognition backend ``
- Run:
``bash dmaf --config config.yaml # Or: python -m dmaf --config config.yaml ``
- Cloud deployment (GCS + Cloud Run, runs on a schedule, scales to zero):
β Follow [deploy/setup-secrets.md](deploy/setup-secrets.md)
π How It Works
graph LR
A[π± WhatsApp Groups] -->|OpenClaw captures| B[πΎ GCS Staging Bucket]
B -->|Cloud Scheduler hourly| C[βοΈ Cloud Run Job]
C --> D{π Face Found?}
D -->|Yes β photo or video| E[πΈ Upload to Google Photos]
D -->|No match| F[βοΈ Skip]
E --> G[ποΈ Firestore Dedup]
F --> G
G -->|path + content SHA256| H[π« Never Reprocess]
- Capture β OpenClaw intercepts WhatsApp group media and saves it locally; a system cron (zero LLM tokens) uploads it to GCS every 30 min
- Schedule β Cloud Scheduler triggers the Cloud Run job hourly β no agent, no AI cost
- Load β Reference photos downloaded from GCS bucket at job startup
- Detect β Each file is scanned: images once, videos sampled at 1β2fps with early exit on first match
- Upload β Matched photos and full video clips are uploaded to Google Photos
- Deduplicate β Two-layer check: (1) path-based Firestore lookup catches already-seen GCS paths; (2) content SHA-256 check catches the same photo arriving via multiple groups or sync paths β face recognition is skipped entirely for known content
βοΈ Configuration
watch_dirs:
- "gs://your-project-whatsapp-media/" # GCS staging bucket (cloud)
- "/path/to/WhatsApp/Images" # Local directory (dev)
known_people_gcs_uri: "gs://your-project-known-people"
recognition:
backend: "auraface" # auraface | insightface | face_recognition
tolerance: 0.5 # 0.0 (strictest) β 1.0 (loosest)
min_face_size_pixels: 20
google_photos_album_name: "Family Faces" # recommended: keeps DMAF uploads separate from camera-roll backup
alerting:
enabled: true
timezone: "America/New_York" # IANA name β used in alert email timestamps
recipients: ["you@example.com"]
Full annotated template: [config.example.yaml](config.example.yaml) | Cloud template: [config.cloud.example.yaml](config.cloud.example.yaml)
π§ Face Recognition Backends
| Feature | AuraFace β | InsightFace | face_recognition (dlib) | |---------|------------|-------------|-------------------------| | License | β Apache 2.0 (commercial OK) | β οΈ Non-commercial | MIT | | False Positive Rate | β 0.0% π‘οΈ | 1.87% | ~11% β οΈ | | Accuracy (TPR) | 80β85% | 82.5% | 92.5% | | Speed | β‘ Fast (12Γ vs dlib) | β‘ Fastest | π’ Slow | | GPU Support | β CUDA | β CUDA | β CPU only | | Best For | π Production | Research | Development |
Use AuraFace for production β zero false positives means zero privacy violations. Commercial license, no restrictions.
π Extensible Architecture
Adding a new backend is simple:
# src/dmaf/face_recognition/your_backend.py
def load_known_faces(known_root: str, **params): ...
def best_match(known_faces, test_image, **params): ...
Register in factory.py and you're done. See existing backends for examples.
π Project Structure
DMAF/
βββ src/dmaf/
β βββ __main__.py # CLI entrypoint + Uploader (on_match / on_match_video)
β βββ config.py # Pydantic settings β all fields with defaults + docs
β βββ watcher.py # Core scan loop + file processing helpers
β βββ video_processor.py # iter_frames generator, find_face_in_video (early exit)
β βββ gcs_watcher.py # GCS helpers: list, download, cleanup
β βββ database.py # SQLite (local) + Firestore (cloud) dedup backends
β βββ known_refresh.py # Auto-refresh training images
β βββ alerting/ # Email alert batching and templates
β βββ face_recognition/ # Backend factory: AuraFace, InsightFace, dlib
βββ deploy/
β βββ setup-secrets.md # π All credentials setup, start here
β βββ openclaw-integration.md # π¦ OpenClaw media sync guide
β βββ openclaw-skill/ # π¦ Installable OpenClaw skill (ClaWHub)
β βββ mcp-setup.md # π MCP server setup (Claude Desktop / Code / Cursor)
β βββ README.md # GCP deployment walkthrough
βββ tests/ # pytest β mirrors src/dmaf structure
βββ AGENTS.md # π€ Coding agent guide (Claude, Copilot, Cursor)
βββ config.example.yaml # Annotated config template (local dev)
βββ config.cloud.example.yaml # Annotated config template (cloud deployment)
π οΈ Development
pip install -e ".[dev,all]"
pre-commit install # ruff + mypy before every commit
pytest tests/ -v # Run tests
mypy src/dmaf # Type check
ruff check src/ tests/ # Lint
See [AGENTS.md](AGENTS.md) for architecture decisions, mock patterns, and CI rules.
πΊοΈ Roadmap
- [x] Phase A: Core bug fixes (RGB/BGR, caching, retry logic) β
- [x] Phase B: Project restructuring (src layout, Pydantic) β
- [x] Phase C: Unit tests (286 tests, 75%+ coverage) β
- [x] Phase D: Face recognition benchmarking & LOOCV validation β
- [x] Phase D+: Advanced detection tuning & FPR analysis β
- [x] Phase E: CI/CD (GitHub Actions, automated testing) β
- [x] Phase F-prep: Observability & auto-refresh (alerts, score tracking, AuraFace) β
- [x] Phase F: Cloud deployment (GCS + Cloud Run + Firestore) β
- [x] Phase G: Documentation, OpenClaw skill, open-source ready β
π€ Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
π License
MIT License β see [LICENSE](LICENSE) for details.
π Acknowledgments
- AuraFace β Apache 2.0 face recognition model
- InsightFace β Deep learning face analysis
- face_recognition β dlib-based recognition
- OpenClaw β AI agent platform with WhatsApp integration
- Google Photos Library API
- Watchdog β File system monitoring
Made with π¦ by yhyatt
Source & license
This open-source MCP server is cataloged on AgentStack and links to its original source β we do not rehost the code.
- Author: yhyatt
- Source: yhyatt/DMAF
- License: MIT
- Homepage: https://clawhub.ai/skills/dmaf
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet β be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.