Public APIs
Face-api.js favicon

Face-api.js

AI

JavaScript API for face detection, recognition, and emotion analysis using TensorFlow.js.

Face-api.js's website screenshot

About Face-api.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.

Key features

  • Face detection with multiple detector options (SSD Mobilenet v1, Tiny Face Detector, MTCNN, Tiny YOLOv2)
  • 68-point face landmark detection
  • Face recognition for identifying and matching faces
  • Face expression recognition
  • Age estimation and gender recognition

Frequently asked questions

What platforms does face-api.js support?

It runs in the browser and in Node.js, built on top of tensorflow.js core.

How do I install face-api.js?

Include the script from dist/face-api.js or install it via npm with 'npm i face-api.js'.

Does it work with Node.js out of the box?

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.

What license is face-api.js released under?

It is released under the MIT license.

Who is face-api.js for?

It is for JavaScript developers who want to add face detection and face recognition capabilities to browser or Node.js applications.

Advertise here

Featured products

  • SerpApi - Search API favicon
  • Screenshot Scout favicon
  • TalorData favicon
  • CoreClaw favicon

Show your product to thousands of developers

· 100k monthly pageviews
· 7k newsletter subscribers

Advertise your product