JavaScript API for face detection, recognition, and emotion analysis using TensorFlow.js.
Face-api.js is a JavaScript library for face detection and face recognition that runs in both the browser and Node.js, built on top of tensorflow.js core. It provides face landmark detection, face expression recognition, and age estimation and gender recognition, exposed through a set of neural network models (such as SsdMobilenetv1, TinyFaceDetector, TinyYolov2, FaceLandmark68Net, FaceRecognitionNet, AgeGenderNet, and FaceExpressionNet) accessible via a high-level API.
Models are loaded by providing a manifest.json file along with corresponding weight shard files, either from a URI in browser environments or directly from disk in Node.js. For Node.js use, the library requires polyfills for browser-specific objects like HTMLCanvasElement, HTMLImageElement, and ImageData, typically provided via the node-canvas package, with optional integration of @tensorflow/tfjs-node for faster native performance.
The library is intended for developers building applications that need face detection and recognition functionality in JavaScript or TypeScript, distributed via npm and usable through a script include in the browser or as an npm package in Node.js projects. It is released under the MIT license.
It runs in the browser and in Node.js, built on top of tensorflow.js core.
Include the script from dist/face-api.js or install it via npm with 'npm i face-api.js'.
In Node.js you need to polyfill browser specifics like HTMLImageElement and HTMLCanvasElement, typically using the node-canvas package, and can optionally add @tensorflow/tfjs-node for faster performance.
It is released under the MIT license.
It is for JavaScript developers who want to add face detection and face recognition capabilities to browser or Node.js applications.
Show your product to thousands of developers
· 100k monthly pageviews
· 7k newsletter subscribers
RAG API with RESTful endpoints, comprehensive SDKs, and enterprise-grade reliability.
Natural Language Processing.
Get all AI models in one place, e.g. OpenAI, Google and lots more!
Artificial intelligence API's.
Discovery API for AI agents & MCP servers (search, verify, UAID, chat).
Image Recognition Solutions like Tagging, Visual Search, NSFW moderation.