// the find
justadudewhohacks/face-api.js
JavaScript API for face detection and face recognition in the browser and nodejs with tensorflow.js
face-api.js is a browser and Node.js library for face detection, landmark tracking, recognition, expression classification, and age/gender estimation, all running locally via TensorFlow.js. It targets developers who want client-side face ML without a server or cloud API. The repo has nearly 18K stars but has been effectively unmaintained for the past couple of years while the TF.js ecosystem has kept moving.
1. Fluent chainable API — `detectAllFaces(input).withFaceLandmarks().withFaceDescriptors()` reads like a sentence, and the TypeScript types enforce only valid chains at compile time.
2. Multiple model size/accuracy tradeoffs baked in — 190KB Tiny Face Detector for real-time webcam use, 5.4MB SSD MobileNet V1 when you need higher accuracy on small faces.
3. Everything runs client-side with no API calls, so face data never leaves the browser — a meaningful privacy property for consumer apps.
4. Pre-trained weights at genuinely useful accuracy: 99.38% on LFW for recognition, 95% gender accuracy, 4.5-year MAE for age — good enough to ship for most hobby/prototyping use cases.
1. Effectively abandoned — TF.js has gone through multiple breaking releases since this was actively maintained; you will hit compatibility issues and there is no one upstream to fix them.
2. Node.js setup requires monkey-patching the environment with node-canvas, plus Python for the native TF bindings — works until something breaks, at which point you're debugging a three-library version triangle.
3. Binary male/female gender model with no way to update it short of retraining on your own, and the training code is not included.
4. Model weights must be self-hosted as multiple shard files plus a manifest.json — no npm-bundled weights, no CDN option out of the box, so deployment means managing additional static file hosting.