🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

ai-face-detection

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
a

ai-face-detection

This is simple face detection using face-api.js and tensorflow.js

1.0.10
latest
76

Supply Chain Security

100

Vulnerability

82

Quality

76

Maintenance

100

License

Version published
Weekly downloads
14
-39.13%
Maintainers
1
Weekly downloads
 
Created
Issues
0

Face detection

This is simple face detection using face-api.js and tensorflow.js

Getting Started

npm install

Usage

import { detectFaces } from 'ai-face-detection'

// using remote image
const imageFromUrl = 'https://upload.wikimedia.org/wikipedia/commons/thumb/e/ed/Elon_Musk_Royal_Society.jpg/640px-Elon_Musk_Royal_Society.jpg'

// using local image
const imageFromFile = './face/face1.jpeg'

faceDetect(imageFromUrl)
  .then((result) => {
        console.log(
        `Face detected gender: ${result?.gender} with probability ${result?.genderProbability}`
        )
        console.log(`Face detected age: ${result?.age}`)
        console.log(`Face detected expressions:`)
        console.log(result?.expressions.asSortedArray())
  })
  .catch((err) => {
    // console.log('err, ', err)
    logger.error('err, ', err)
  })

License

The MIT License (MIT). Please see License File for more information.

FAQs

Package last updated on 18 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts