AI Age Prediction · Powered by the Internet Computer
FaceClock is a full-stack decentralized application built on the Internet Computer (ICP). It uses face-api.js in the browser to detect faces via webcam, captures a sequence of keyframes, and sends them to a Rust-based backend canister for statistical age prediction.
- Frontend: Vanilla HTML/CSS/JS served from an ICP asset canister. Uses
face-api.js(TinyFaceDetector + AgeGenderNet) for real-time client-side face detection and bounding box rendering. - Backend: Rust canister that receives multiple face crops/estimates and performs statistical aggregation (IQR outlier rejection and confidence-weighted mean) to produce a final, robust age prediction.
- Communication: The frontend communicates with the backend via the
@dfinity/agentlibrary.
- DFINITY Canister SDK (
dfx) - Rust Toolchain (with
wasm32-unknown-unknowntarget)
- Clone the repository
- Start the local Internet Computer replica in the background:
dfx start --background - Deploy the canisters to your local replica:
dfx deploy - Open the frontend URL provided in the
dfx deployoutput in your browser (usuallyhttp://<canister-id>.localhost:4943/).
src/faceclock_backend/: Contains the Rust source code for the backend canister.src/lib.rs: The main logic for age prediction aggregation.faceclock_backend.did: The Candid interface definition.
src/faceclock_frontend/: Contains the frontend assets.assets/: HTML, CSS, JavaScript, and theface-api.jsmodels.
dfx.json: The dfx project configuration file.
Face detection runs entirely locally in your browser. No images or video feeds are stored or transmitted. Only the structured data (the estimated age and confidence per frame) is sent to the backend canister for final statistical processing.
This project is open-source and available under the MIT License.