/angular-face-api

<Angular x Face-api.js> | This is a sample code of Face-api.js in Angular, here am using Angular v17

Primary LanguageTypeScript

Angular x Face-api.js

This is a sample code of Face-api.js in Angular, here am using Angular v17.

Face-api.js is a JavaScript API for face detection and face recognition in the browser and nodejs with tensorflow.js

Screenshot Demo

screenshot demo

Online Demo

Demo by Vercel

Features of This Project

  • Smile Detection
  • Blink (Eyes) Detection
  • Mount Detection
  • Head Pose
  • Age and Gender

Build With

How to run?

  • Clone this repo
  • yarn install or npm install
  • Run yarn start or ng serve command for running this project
  • After that access in your browser http://localhost:4200/

How to build?

  • Run yarn build or ng build --base-href ./ --configuration production command for build project

How to test build result?

  • Go to THE_PROJECT/dist/face-detection/browser
  • Run npm install -g http-server for install http-server
  • After that run npx http-server command for running build result file

More Info

Method

You can call the startVideo() method to start scanning the face manually. and call the stopVideo() method to stop scanning manually.

Models

You can see all models data Here

package.json

Put this after devDependencies to remove warning messages when run or build a project.

"browser": {
  "fs": false,
  "os": false,
  "path": false
}

angular.json

Put this on architect > build > options to remove warning messages when run or build a project.

"allowedCommonJsDependencies": [
  "fast-deep-equal",
  "css.escape",
  "path-intersection",
  "selection-update",
  "@tensorflow/tfjs-core"
],

Author

Kang Cahya