{"id":16221535,"url":"https://github.com/vladmandic/face-api","last_synced_at":"2025-03-11T02:31:34.254Z","repository":{"id":41357597,"uuid":"288436069","full_name":"vladmandic/face-api","owner":"vladmandic","description":"FaceAPI: AI-powered Face Detection \u0026 Rotation Tracking, Face Description \u0026 Recognition, Age \u0026 Gender \u0026 Emotion Prediction for Browser and NodeJS using TensorFlow/JS","archived":true,"fork":false,"pushed_at":"2024-09-10T15:31:08.000Z","size":76511,"stargazers_count":852,"open_issues_count":0,"forks_count":152,"subscribers_count":25,"default_branch":"master","last_synced_at":"2024-10-29T20:55:51.261Z","etag":null,"topics":["age-gender","emotion-detection","face-api","face-detection","face-recognition","tensorflow","tfjs"],"latest_commit_sha":null,"homepage":"https://vladmandic.github.io/face-api/demo/webcam.html","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vladmandic.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["vladmandic"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2020-08-18T11:24:46.000Z","updated_at":"2024-10-25T10:34:56.000Z","dependencies_parsed_at":"2024-06-18T12:39:39.968Z","dependency_job_id":"f4c3deb4-25ae-4cf7-9979-3c79c24571a4","html_url":"https://github.com/vladmandic/face-api","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vladmandic%2Fface-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vladmandic%2Fface-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vladmandic%2Fface-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vladmandic%2Fface-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vladmandic","download_url":"https://codeload.github.com/vladmandic/face-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242959365,"owners_count":20212969,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["age-gender","emotion-detection","face-api","face-detection","face-recognition","tensorflow","tfjs"],"created_at":"2024-10-10T12:08:35.922Z","updated_at":"2025-03-11T02:31:34.237Z","avatar_url":"https://github.com/vladmandic.png","language":"HTML","funding_links":["https://github.com/sponsors/vladmandic"],"categories":[],"sub_categories":[],"readme":"![Git Version](https://img.shields.io/github/package-json/v/vladmandic/face-api?style=flat-square\u0026svg=true\u0026label=git)\n![NPM Version](https://img.shields.io/npm/v/@vladmandic/face-api.png?style=flat-square)\n![Last Commit](https://img.shields.io/github/last-commit/vladmandic/face-api?style=flat-square?svg=true)\n![License](https://img.shields.io/github/license/vladmandic/face-api?style=flat-square?svg=true)\n![GitHub Status Checks](https://img.shields.io/github/checks-status/vladmandic/face-api/master?style=flat-square?svg=true)\n![Vulnerabilities](https://img.shields.io/snyk/vulnerabilities/github/vladmandic/face-api?style=flat-square?svg=true)\n\n# FaceAPI\n\n**AI-powered Face Detection \u0026 Rotation Tracking, Face Description \u0026 Recognition, Age \u0026 Gender \u0026 Emotion Prediction for Browser and NodeJS using TensorFlow/JS**\n\n\u003cbr\u003e\n\n**Live Demo**: \u003chttps://vladmandic.github.io/face-api/demo/webcam.html\u003e\n\n\u003cbr\u003e\n\n## Additional Documentation\n\n- [**Tutorial**](TUTORIAL.md)\n- [**TypeDoc API Specification**](https://vladmandic.github.io/face-api/typedoc/index.html)\n\n\u003cbr\u003e\u003chr\u003e\u003cbr\u003e\n\n## Examples\n\n\u003cbr\u003e\n\n### Browser\n\nBrowser example that uses static images and showcases both models  \nas well as all of the extensions is included in `/demo/index.html`  \nExample can be accessed directly using Git pages using URL:  \n\u003chttps://vladmandic.github.io/face-api/demo/index.html\u003e  \n\nBrowser example that uses live webcam is included in `/demo/webcam.html`  \nExample can be accessed directly using Git pages using URL:  \n\u003chttps://vladmandic.github.io/face-api/demo/webcam.html\u003e  \n\n\n\u003cbr\u003e\n\n**Demo using FaceAPI to process images**  \n*Note: Photos shown below are taken by me*\n\n![screenshot](demo/screenshot-images.png)\n\n**Demo using FaceAPI to process live webcam**  \n\n![screenshot](demo/screenshot-webcam.png)\n\n\u003cbr\u003e\n\n### NodeJS\n\nNodeJS examples are:\n\n- `/demo/node-simple.js`:\n  Simplest possible NodeJS demo for FaceAPI in under 30 lines of JavaScript code  \n- `/demo/node.js`:  \n  Using `TFJS` native methods to load images without external dependencies  \n- `/demo/node-canvas.js` and `/demo/node-image.js`:  \n  Using external `canvas` module to load images  \n  Which also allows for image drawing and saving inside `NodeJS` environment  \n- `/demo/node-match.js`:  \n  Simple demo that compares face similarity from a given image  \n  to a second image or list of images in a folder  \n- `/demo/node-multiprocess.js`:  \n  Multiprocessing showcase that uses pool of worker processes  \n  (`node-multiprocess-worker.js`)  \n  Main starts fixed pool of worker processes with each worker having  \n  it's instance of `FaceAPI`  \n  Workers communicate with main when they are ready and main dispaches  \n  job to each ready worker until job queue is empty  \n\n```json\n2021-03-14 08:42:03 INFO:  @vladmandic/face-api version 1.0.2\n2021-03-14 08:42:03 INFO:  User: vlado Platform: linux Arch: x64 Node: v15.7.0\n2021-03-14 08:42:03 INFO:  FaceAPI multi-process test\n2021-03-14 08:42:03 STATE:  Main: started worker: 1888019\n2021-03-14 08:42:03 STATE:  Main: started worker: 1888025\n2021-03-14 08:42:04 STATE:  Worker: PID: 1888025 TensorFlow/JS 3.3.0 FaceAPI 1.0.2 Backend: tensorflow\n2021-03-14 08:42:04 STATE:  Worker: PID: 1888019 TensorFlow/JS 3.3.0 FaceAPI 1.0.2 Backend: tensorflow\n2021-03-14 08:42:04 STATE:  Main: dispatching to worker: 1888019\n2021-03-14 08:42:04 STATE:  Main: dispatching to worker: 1888025\n2021-03-14 08:42:04 DATA:  Worker received message: 1888019 { image: 'demo/sample1.jpg' }\n2021-03-14 08:42:04 DATA:  Worker received message: 1888025 { image: 'demo/sample2.jpg' }\n2021-03-14 08:42:06 DATA:  Main: worker finished: 1888025 detected faces: 3\n2021-03-14 08:42:06 STATE:  Main: dispatching to worker: 1888025\n2021-03-14 08:42:06 DATA:  Worker received message: 1888025 { image: 'demo/sample3.jpg' }\n2021-03-14 08:42:06 DATA:  Main: worker finished: 1888019 detected faces: 3\n2021-03-14 08:42:06 STATE:  Main: dispatching to worker: 1888019\n2021-03-14 08:42:06 DATA:  Worker received message: 1888019 { image: 'demo/sample4.jpg' }\n2021-03-14 08:42:07 DATA:  Main: worker finished: 1888025 detected faces: 3\n2021-03-14 08:42:07 STATE:  Main: dispatching to worker: 1888025\n2021-03-14 08:42:07 DATA:  Worker received message: 1888025 { image: 'demo/sample5.jpg' }\n2021-03-14 08:42:08 DATA:  Main: worker finished: 1888019 detected faces: 4\n2021-03-14 08:42:08 STATE:  Main: dispatching to worker: 1888019\n2021-03-14 08:42:08 DATA:  Worker received message: 1888019 { image: 'demo/sample6.jpg' }\n2021-03-14 08:42:09 DATA:  Main: worker finished: 1888025 detected faces: 5\n2021-03-14 08:42:09 STATE:  Main: worker exit: 1888025 0\n2021-03-14 08:42:09 DATA:  Main: worker finished: 1888019 detected faces: 4\n2021-03-14 08:42:09 INFO:  Processed 15 images in 5944 ms\n2021-03-14 08:42:09 STATE:  Main: worker exit: 1888019 0\n```\n\n### NodeJS Notes\n- Supported NodeJS versions are **14** up to **22**  \n  NodeJS version **23** and higher are not supported due to incompatibility with TensorFlow/JS  \n- `@tensorflow/tfjs-node` or `@tensorflow/tfjs-node-gpu`  \n  must be installed before using any **NodeJS** examples  \n\n\u003cbr\u003e\u003chr\u003e\u003cbr\u003e\n\n## Quick Start\n\nSimply include latest version of `FaceAPI` directly from a CDN in your HTML:  \n(pick one, `jsdelivr` or `unpkg`)\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/@vladmandic/face-api/dist/face-api.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://unpkg.dev/@vladmandic/face-api/dist/face-api.js\"\u003e\u003c/script\u003e\n```\n\n## Installation\n\n`FaceAPI` ships with several pre-build versions of the library:\n\n- `dist/face-api.js`: IIFE format for client-side Browser execution  \n   *with* TFJS pre-bundled\n- `dist/face-api.esm.js`: ESM format for client-side Browser execution  \n   *with* TFJS pre-bundled\n- `dist/face-api.esm-nobundle.js`: ESM format for client-side Browser execution  \n   *without* TFJS pre-bundled\n- `dist/face-api.node.js`: CommonJS format for server-side NodeJS execution  \n   *without* TFJS pre-bundled\n- `dist/face-api.node-gpu.js`: CommonJS format for server-side NodeJS execution  \n   *without* TFJS pre-bundled and optimized for CUDA GPU acceleration\n\nDefaults are:\n\n```json\n{\n  \"main\": \"dist/face-api.node-js\",\n  \"module\": \"dist/face-api.esm.js\",\n  \"browser\": \"dist/face-api.esm.js\",\n}\n```\n\nBundled `TFJS` can be used directly via export: `faceapi.tf`\n\nReason for additional `nobundle` version is if you want to  \ninclude a specific version of TFJS and not rely on  pre-packaged one  \n\n`FaceAPI` is compatible with TFJS 2.0+ and TFJS 3.0+  \n\nAll versions include `sourcemap`\n\n\u003cbr\u003e\u003chr\u003e\u003cbr\u003e\n\nThere are several ways to use FaceAPI:\n\n### 1. IIFE script\n\n*Recommened for quick tests and backward compatibility with older Browsers that do not support ESM such as IE*\n\nThis is simplest way for usage within Browser  \nSimply download `dist/face-api.js`, include it in your `HTML` file \u0026 it's ready to use:\n\n```html\n\u003cscript src=\"dist/face-api.js\"\u003e\u003cscript\u003e\n```\n\nOr skip the download and include it directly from a CDN:\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/@vladmandic/face-api/dist/face-api.js\"\u003e\u003c/script\u003e\n```\n\nIIFE script bundles TFJS and auto-registers global namespace `faceapi` within Window object which can be accessed directly from a `\u003cscript\u003e` tag or from your JS file.  \n\n\u003cbr\u003e\n\n### 2. ESM module\n\n*Recommended for usage within Browser*\n\n#### 2.1. Direct Import\n\nTo use ESM import directly in a Browser, you must import your script (e.g. `index.js`) with a `type=\"module\"`  \n\n```html\n  \u003cscript src=\"./index.js\" type=\"module\"\u003e\n```\n\nand then in your `index.js`\n\n```js\n  import * as faceapi from 'dist/face-api.esm.js';\n```\n\n#### 2.2. With Bundler\n\nSame as above, but expectation is that you've installed `@vladmandic/faceapi` package:\n\n```shell\n  npm install @vladmandic/face-api \n```\n\nand that you'll package your application using a bundler such as `webpack`, `rollup` or `esbuild`  \nin which case, you do not need to import a script as module - that depends on your bundler configuration  \n\n```js\n  import * as faceapi from '@vladmandic/face-api';\n```\n\nor if your bundler doesn't recognize `recommended` type, force usage with:\n\n```js\n  import * as faceapi from '@vladmandic/face-api/dist/face-api.esm.js';\n```\n\nor to use non-bundled version\n\n```js\n  import * as tf from `@tensorflow/tfjs`;\n  import * as faceapi from '@vladmandic/face-api/dist/face-api.esm-nobundle.js';\n```\n\n\u003cbr\u003e\n\n### 3. NPM module\n\n#### 3.1. Import CommonJS\n\n*Recommended for NodeJS projects*\n\n*Node: FaceAPI for NodeJS does not bundle TFJS due to binary dependencies that are installed during TFJS installation*\n\nInstall with:\n\n```shell\n  npm install @tensorflow/tfjs-node\n  npm install @vladmandic/face-api \n```\n\nAnd then use with:\n\n```js\n  const tf = require('@tensorflow/tfjs-node')\n  const faceapi = require('@vladmandic/face-api');\n```\n\nIf you want to force CommonJS module instead of relying on `recommended` field:\n\n```js\n  const faceapi = require('@vladmandic/face-api/dist/face-api.node.js');\n```\n\nIf you want to GPU Accelerated execution in NodeJS, you must have CUDA libraries already installed and working  \nThen install appropriate version of `FaceAPI`:\n\n```shell\n  npm install @tensorflow/tfjs-node-gpu\n  npm install @vladmandic/face-api \n```\n\nAnd then use with:\n\n```js\n  const tf = require('@tensorflow/tfjs-node-gpu')\n  const faceapi = require('@vladmandic/face-api/dist/face-api.node-gpu.js'); // this loads face-api version with correct bindings for tfjs-node-gpu\n```\n\nIf you want to use `FaceAPI` in a NodeJS on platforms where **tensorflow** binary libraries are not supported, you can use NodeJS **WASM** backend.  \n\n```shell\n  npm install @tensorflow/tfjs\n  npm install @tensorflow/tfjs-backend-wasm\n  npm install @vladmandic/face-api \n```\n\nAnd then use with:\n\n```js\n  const tf = require('@tensorflow/tfjs');\n  const wasm = require('@tensorflow/tfjs-backend-wasm');\n  const faceapi = require('@vladmandic/face-api/dist/face-api.node-wasm.js'); // use this when using face-api in dev mode\n  wasm.setWasmPaths('https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm/dist/');\n  await tf.setBackend('wasm');\n  await tf.ready();\n  ...\n```\n\nIf you want to use graphical functions inside NodeJS,  \nyou must provide appropriate graphical library as  \nNodeJS does not include implementation for DOM elements  \nsuch as HTMLImageElement or HTMLCanvasElement:\n\nInstall `Canvas` for NodeJS:\n\n```shell\nnpm install canvas\n```\n\nPatch NodeJS environment to use newly installed `Canvas` library:\n\n```js\nconst canvas = require('canvas');\nconst faceapi = require('@vladmandic/face-api');\n\nconst { Canvas, Image, ImageData } = canvas\nfaceapi.env.monkeyPatch({ Canvas, Image, ImageData })\n```\n\n\u003cbr\u003e\u003chr\u003e\u003cbr\u003e\n\n## Weights\n\nPretrained models and their weights are included in `./model`.\n\n\u003cbr\u003e\u003chr\u003e\u003cbr\u003e\n\n## Test \u0026 Dev Web Server\n\nTo install development dependencies, use `npm install --production=false`\n\nBuilt-in test\u0026dev web server can be started using\n\n```shell\nnpm run dev\n```\n\nBy default it starts HTTP server on port 8000 and HTTPS server on port 8001 and can be accessed as:  \n\n- \u003chttps://localhost:8001/demo/index.html\u003e\n- \u003chttps://localhost:8001/demo/webcam.html\u003e\n\n```js\n2022-01-14 09:56:19 INFO:  @vladmandic/face-api version 1.6.4\n2022-01-14 09:56:19 INFO:  User: vlado Platform: linux Arch: x64 Node: v17.2.0\n2022-01-14 09:56:19 INFO:  Application: { name: '@vladmandic/face-api', version: '1.6.4' }\n2022-01-14 09:56:19 INFO:  Environment: { profile: 'development', config: '.build.json', package: 'package.json', tsconfig: true, eslintrc: true, git: true }\n2022-01-14 09:56:19 INFO:  Toolchain: { build: '0.6.7', esbuild: '0.14.11', typescript: '4.5.4', typedoc: '0.22.10', eslint: '8.6.0' }\n2022-01-14 09:56:19 INFO:  Build: { profile: 'development', steps: [ 'serve', 'watch', 'compile' ] }\n2022-01-14 09:56:19 STATE: WebServer: { ssl: false, port: 8000, root: '.' }\n2022-01-14 09:56:19 STATE: WebServer: { ssl: true, port: 8001, root: '.', sslKey: 'build/cert/https.key', sslCrt: 'build/cert/https.crt' }\n2022-01-14 09:56:19 STATE: Watch: { locations: [ 'src/**', 'README.md', 'src/**', 'src/**' ] }\n2022-01-14 09:56:19 STATE: Compile: { name: 'tfjs/node/cpu', format: 'cjs', platform: 'node', input: 'src/tfjs/tf-node.ts', output: 'dist/tfjs.esm.js', files: 1, inputBytes: 143, outputBytes: 1276 }\n2022-01-14 09:56:19 STATE: Compile: { name: 'faceapi/node/cpu', format: 'cjs', platform: 'node', input: 'src/index.ts', output: 'dist/face-api.node.js', files: 162, inputBytes: 234787, outputBytes: 175203 }\n2022-01-14 09:56:19 STATE: Compile: { name: 'tfjs/node/gpu', format: 'cjs', platform: 'node', input: 'src/tfjs/tf-node-gpu.ts', output: 'dist/tfjs.esm.js', files: 1, inputBytes: 147, outputBytes: 1296 }\n2022-01-14 09:56:19 STATE: Compile: { name: 'faceapi/node/gpu', format: 'cjs', platform: 'node', input: 'src/index.ts', output: 'dist/face-api.node-gpu.js', files: 162, inputBytes: 234807, outputBytes: 175219 }\n2022-01-14 09:56:19 STATE: Compile: { name: 'tfjs/node/wasm', format: 'cjs', platform: 'node', input: 'src/tfjs/tf-node-wasm.ts', output: 'dist/tfjs.esm.js', files: 1, inputBytes: 185, outputBytes: 1367 }\n2022-01-14 09:56:19 STATE: Compile: { name: 'faceapi/node/wasm', format: 'cjs', platform: 'node', input: 'src/index.ts', output: 'dist/face-api.node-wasm.js', files: 162, inputBytes: 234878, outputBytes: 175294 }\n2022-01-14 09:56:19 STATE: Compile: { name: 'tfjs/browser/tf-version', format: 'esm', platform: 'browser', input: 'src/tfjs/tf-version.ts', output: 'dist/tfjs.version.js', files: 1, inputBytes: 1063, outputBytes: 1662 }\n2022-01-14 09:56:19 STATE: Compile: { name: 'tfjs/browser/esm/nobundle', format: 'esm', platform: 'browser', input: 'src/tfjs/tf-browser.ts', output: 'dist/tfjs.esm.js', files: 2, inputBytes: 2172, outputBytes: 811 }\n2022-01-14 09:56:19 STATE: Compile: { name: 'faceapi/browser/esm/nobundle', format: 'esm', platform: 'browser', input: 'src/index.ts', output: 'dist/face-api.esm-nobundle.js', files: 162, inputBytes: 234322, outputBytes: 169437 }\n2022-01-14 09:56:19 STATE: Compile: { name: 'tfjs/browser/esm/bundle', format: 'esm', platform: 'browser', input: 'src/tfjs/tf-browser.ts', output: 'dist/tfjs.esm.js', files: 11, inputBytes: 2172, outputBytes: 2444105 }\n2022-01-14 09:56:20 STATE: Compile: { name: 'faceapi/browser/iife/bundle', format: 'iife', platform: 'browser', input: 'src/index.ts', output: 'dist/face-api.js', files: 162, inputBytes: 2677616, outputBytes: 1252572 }\n2022-01-14 09:56:20 STATE: Compile: { name: 'faceapi/browser/esm/bundle', format: 'esm', platform: 'browser', input: 'src/index.ts', output: 'dist/face-api.esm.js', files: 162, inputBytes: 2677616, outputBytes: 2435063 }\n2022-01-14 09:56:20 INFO:  Listening...\n...\n2022-01-14 09:56:46 DATA:  HTTPS: { method: 'GET', ver: '2.0', status: 200, mime: 'text/html', size: 1047, url: '/', remote: '::1' }\n2022-01-14 09:56:46 DATA:  HTTPS: { method: 'GET', ver: '2.0', status: 200, mime: 'text/javascript', size: 6919, url: '/index.js', remote: '::1' }\n2022-01-14 09:56:46 DATA:  HTTPS: { method: 'GET', ver: '2.0', status: 200, mime: 'text/javascript', size: 2435063, url: '/dist/face-api.esm.js', remote: '::1' }\n2022-01-14 09:56:47 DATA:  HTTPS: { method: 'GET', ver: '2.0', status: 200, mime: 'application/octet-stream', size: 4125244, url: '/dist/face-api.esm.js.map', remote: '::1' }\n2022-01-14 09:56:47 DATA:  HTTPS: { method: 'GET', ver: '2.0', status: 200, mime: 'application/json', size: 3219, url: '/model/tiny_face_detector_model-weights_manifest.json', remote: '::1' }\n2022-01-14 09:56:47 DATA:  HTTPS: { method: 'GET', ver: '2.0', status: 200, mime: 'application/octet-stream', size: 193321, url: '/model/tiny_face_detector_model.bin', remote: '::1' }\n2022-01-14 09:56:47 DATA:  HTTPS: { method: 'GET', ver: '2.0', status: 200, mime: 'application/json', size: 28233, url: '/model/ssd_mobilenetv1_model-weights_manifest.json', remote: '::1' }\n2022-01-14 09:56:47 DATA:  HTTPS: { method: 'GET', ver: '2.0', status: 200, mime: 'application/octet-stream', size: 5616957, url: '/model/ssd_mobilenetv1_model.bin', remote: '::1' }\n2022-01-14 09:56:48 DATA:  HTTPS: { method: 'GET', ver: '2.0', status: 200, mime: 'application/json', size: 8392, url: '/model/age_gender_model-weights_manifest.json', remote: '::1' }\n2022-01-14 09:56:48 DATA:  HTTPS: { method: 'GET', ver: '2.0', status: 200, mime: 'application/octet-stream', size: 429708, url: '/model/age_gender_model.bin', remote: '::1' }\n2022-01-14 09:56:48 DATA:  HTTPS: { method: 'GET', ver: '2.0', status: 200, mime: 'application/json', size: 8485, url: '/model/face_landmark_68_model-weights_manifest.json', remote: '::1' }\n2022-01-14 09:56:48 DATA:  HTTPS: { method: 'GET', ver: '2.0', status: 200, mime: 'application/octet-stream', size: 356840, url: '/model/face_landmark_68_model.bin', remote: '::1' }\n2022-01-14 09:56:48 DATA:  HTTPS: { method: 'GET', ver: '2.0', status: 200, mime: 'application/json', size: 19615, url: '/model/face_recognition_model-weights_manifest.json', remote: '::1' }\n2022-01-14 09:56:48 DATA:  HTTPS: { method: 'GET', ver: '2.0', status: 200, mime: 'application/octet-stream', size: 6444032, url: '/model/face_recognition_model.bin', remote: '::1' }\n2022-01-14 09:56:48 DATA:  HTTPS: { method: 'GET', ver: '2.0', status: 200, mime: 'application/json', size: 6980, url: '/model/face_expression_model-weights_manifest.json', remote: '::1' }\n2022-01-14 09:56:48 DATA:  HTTPS: { method: 'GET', ver: '2.0', status: 200, mime: 'application/octet-stream', size: 329468, url: '/model/face_expression_model.bin', remote: '::1' }\n2022-01-14 09:56:48 DATA:  HTTPS: { method: 'GET', ver: '2.0', status: 200, mime: 'image/jpeg', size: 144516, url: '/sample1.jpg', remote: '::1' }\n```\n\n\u003cbr\u003e\u003chr\u003e\u003cbr\u003e\n\n## Build\n\nIf you want to do a full rebuild, either download npm module\n\n```shell\nnpm install @vladmandic/face-api\ncd node_modules/@vladmandic/face-api\n```\n\nor clone a git project\n\n```shell\ngit clone https://github.com/vladmandic/face-api\ncd face-api\n```\n\nThen install all dependencies and run rebuild:\n\n```shell\nnpm install --production=false\nnpm run build\n```\n\nBuild process uses `@vladmandic/build` module that creates optimized build for each target:\n\n```js\n\u003e @vladmandic/face-api@1.7.1 build /home/vlado/dev/face-api\n\u003e node build.js\n\n2022-07-25 08:21:05 INFO:  Application: { name: '@vladmandic/face-api', version: '1.7.1' }\n2022-07-25 08:21:05 INFO:  Environment: { profile: 'production', config: '.build.json', package: 'package.json', tsconfig: true, eslintrc: true, git: true }\n2022-07-25 08:21:05 INFO:  Toolchain: { build: '0.7.7', esbuild: '0.14.50', typescript: '4.7.4', typedoc: '0.23.9', eslint: '8.20.0' }\n2022-07-25 08:21:05 INFO:  Build: { profile: 'production', steps: [ 'clean', 'compile', 'typings', 'typedoc', 'lint', 'changelog' ] }\n2022-07-25 08:21:05 STATE: Clean: { locations: [ 'dist/*', 'typedoc/*', 'types/lib/src' ] }\n2022-07-25 08:21:05 STATE: Compile: { name: 'tfjs/node/cpu', format: 'cjs', platform: 'node', input: 'src/tfjs/tf-node.ts', output: 'dist/tfjs.esm.js', files: 1, inputBytes: 143, outputBytes: 614 }\n2022-07-25 08:21:05 STATE: Compile: { name: 'faceapi/node/cpu', format: 'cjs', platform: 'node', input: 'src/index.ts', output: 'dist/face-api.node.js', files: 162, inputBytes: 234137, outputBytes: 85701 }\n2022-07-25 08:21:05 STATE: Compile: { name: 'tfjs/node/gpu', format: 'cjs', platform: 'node', input: 'src/tfjs/tf-node-gpu.ts', output: 'dist/tfjs.esm.js', files: 1, inputBytes: 147, outputBytes: 618 }\n2022-07-25 08:21:05 STATE: Compile: { name: 'faceapi/node/gpu', format: 'cjs', platform: 'node', input: 'src/index.ts', output: 'dist/face-api.node-gpu.js', files: 162, inputBytes: 234141, outputBytes: 85705 }\n2022-07-25 08:21:05 STATE: Compile: { name: 'tfjs/node/wasm', format: 'cjs', platform: 'node', input: 'src/tfjs/tf-node-wasm.ts', output: 'dist/tfjs.esm.js', files: 1, inputBytes: 185, outputBytes: 670 }\n2022-07-25 08:21:05 STATE: Compile: { name: 'faceapi/node/wasm', format: 'cjs', platform: 'node', input: 'src/index.ts', output: 'dist/face-api.node-wasm.js', files: 162, inputBytes: 234193, outputBytes: 85755 }\n2022-07-25 08:21:05 STATE: Compile: { name: 'tfjs/browser/tf-version', format: 'esm', platform: 'browser', input: 'src/tfjs/tf-version.ts', output: 'dist/tfjs.version.js', files: 1, inputBytes: 1063, outputBytes: 400 }\n2022-07-25 08:21:05 STATE: Compile: { name: 'tfjs/browser/esm/nobundle', format: 'esm', platform: 'browser', input: 'src/tfjs/tf-browser.ts', output: 'dist/tfjs.esm.js', files: 2, inputBytes: 910, outputBytes: 527 }\n2022-07-25 08:21:05 STATE: Compile: { name: 'faceapi/browser/esm/nobundle', format: 'esm', platform: 'browser', input: 'src/index.ts', output: 'dist/face-api.esm-nobundle.js', files: 162, inputBytes: 234050, outputBytes: 82787 }\n2022-07-25 08:21:05 STATE: Compile: { name: 'tfjs/browser/esm/bundle', format: 'esm', platform: 'browser', input: 'src/tfjs/tf-browser.ts', output: 'dist/tfjs.esm.js', files: 11, inputBytes: 910, outputBytes: 1184871 }\n2022-07-25 08:21:05 STATE: Compile: { name: 'faceapi/browser/iife/bundle', format: 'iife', platform: 'browser', input: 'src/index.ts', output: 'dist/face-api.js', files: 162, inputBytes: 1418394, outputBytes: 1264631 }\n2022-07-25 08:21:05 STATE: Compile: { name: 'faceapi/browser/esm/bundle', format: 'esm', platform: 'browser', input: 'src/index.ts', output: 'dist/face-api.esm.js', files: 162, inputBytes: 1418394, outputBytes: 1264150 }\n2022-07-25 08:21:07 STATE: Typings: { input: 'src/index.ts', output: 'types/lib', files: 93 }\n2022-07-25 08:21:09 STATE: TypeDoc: { input: 'src/index.ts', output: 'typedoc', objects: 154, generated: true }\n2022-07-25 08:21:13 STATE: Lint: { locations: [ 'src/' ], files: 174, errors: 0, warnings: 0 }\n2022-07-25 08:21:14 STATE: ChangeLog: { repository: 'https://github.com/vladmandic/face-api', branch: 'master', output: 'CHANGELOG.md' }\n2022-07-25 08:21:14 INFO:  Done...\n2022-07-25 08:21:14 STATE: Copy: { input: 'types/lib/dist/tfjs.esm.d.ts' }\n2022-07-25 08:21:15 STATE: API-Extractor: { succeeeded: true, errors: 0, warnings: 417 }\n2022-07-25 08:21:15 INFO:  FaceAPI Build complete...\n```\n\n\u003cbr\u003e\u003chr\u003e\u003cbr\u003e\n\n## Face Mesh\n\n`FaceAPI` landmark model returns 68-point face mesh as detailed in the image below:\n\n![facemesh](demo/facemesh.png)\n\n\u003cbr\u003e\u003chr\u003e\u003cbr\u003e\n\n## Note\n\nThis is updated **face-api.js** with latest available TensorFlow/JS as the original is not compatible with **tfjs \u003e=2.0**.  \nForked from [face-api.js](https://github.com/justadudewhohacks/face-api.js) version **0.22.2** which was released on March 22nd, 2020  \n\n*Why?* I needed a FaceAPI that does not cause version conflict with newer versions of TensorFlow  \nAnd since the original FaceAPI was open-source, I've released this version as well  \n\nChanges ended up being too large for a simple pull request and it ended up being a full-fledged version on its own  \nPlus many features were added since the original inception  \n\nAlthough a lot of work has gone into this version of `FaceAPI` and it will continue to be maintained,  \nat this time it is completely superseded by my newer library `Human` which covers the same use cases,  \nbut extends it with newer AI models, additional detection details, compatibility with latest web standard and more\n\n- [Human NPM](https://www.npmjs.com/package/@vladmandic/human)\n- [Human Git Repository](https://github.com/vladmandic/human)\n\n\u003cbr\u003e\n\n## Differences\n\nCompared to [face-api.js](https://github.com/justadudewhohacks/face-api.js) version **0.22.2**:\n\n- Compatible with `TensorFlow/JS 2.0+, 3.0+ and 4.0+`  \n  Currently using **`TensorFlow/JS` 4.16**  \n  Original `face-api.js` is based on `TFJS` **1.7.4**  \n- Compatible with `WebGL`, `CPU` and `WASM` TFJS Browser backends  \n- Compatible with both `tfjs-node` and `tfjs-node-gpu` TFJS NodeJS backends  \n- Updated all type castings for TypeScript type checking to `TypeScript 5.3`  \n- Switched bundling from `UMD` to `ESM` + `CommonJS` with fallback to `IIFE`  \n  Resulting code is optimized per-platform instead of being universal  \n  Fully tree shakable when imported as an `ESM` module  \n  Browser bundle process uses `ESBuild` instead of `Rollup`  \n- Added separate `face-api` versions with `tfjs` pre-bundled and without `tfjs`  \n  When using `-nobundle` version, user can load any version of `tfjs` manually  \n- Typescript build process now targets `ES2018` and instead of dual `ES5`/`ES6`  \n  Resulting code is clean ES2018 JavaScript without polyfills  \n- Removed old tests, docs, examples  \n- Removed old package dependencies (`karma`, `jasmine`, `babel`, etc.)  \n- Updated all package dependencies  \n- Updated TensorFlow/JS dependencies since backends were removed from `@tensorflow/tfjs-core`  \n- Updated `mobileNetv1` model due to `batchNorm()` dependency  \n- Added `version` class that returns JSON object with version of FaceAPI as well as linked TFJS  \n- Added test/dev built-in HTTP \u0026 HTTPS Web server  \n- Removed `mtcnn` and `tinyYolov2` models as they were non-functional in latest public version of `FaceAPI`  \n  Which means valid models are **tinyFaceDetector** and **mobileNetv1**  \n  *If there is a demand, I can re-implement them back.*  \n- Added `face angle` calculations that returns `roll`, `yaw` and `pitch`  \n- Added `typdoc` automatic API specification generation during build  \n- Added `changelog` automatic generation during build  \n- New process to generate **TypeDocs** bundle using API-Extractor\n\n\u003cbr\u003e\n\n## Credits\n\n- Original project: [face-api.js](https://github.com/justadudewhohacks/face-api.js)\n- Original model weighs: [face-api.js-models](https://github.com/justadudewhohacks/face-api.js-models)\n- ML API Documentation: [Tensorflow/JS](https://js.tensorflow.org/api/latest/)\n\n\u003cbr\u003e\n\n![Stars](https://img.shields.io/github/stars/vladmandic/face-api?style=flat-square?svg=true)\n![Forks](https://badgen.net/github/forks/vladmandic/face-api)\n![Code Size](https://img.shields.io/github/languages/code-size/vladmandic/face-api?style=flat-square?svg=true)\n![CDN](https://data.jsdelivr.com/v1/package/npm/@vladmandic/face-api/badge)\u003cbr\u003e\n![Downloads](https://img.shields.io/npm/dw/@vladmandic/face-api.png?style=flat-square)\n![Downloads](https://img.shields.io/npm/dm/@vladmandic/face-api.png?style=flat-square)\n![Downloads](https://img.shields.io/npm/dy/@vladmandic/face-api.png?style=flat-square)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvladmandic%2Fface-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvladmandic%2Fface-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvladmandic%2Fface-api/lists"}