Socket
Socket
Sign inDemoInstall

ai-face-detection

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ai-face-detection

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


Version published
Weekly downloads
28
increased by55.56%
Maintainers
1
Weekly downloads
 
Created
Source

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.

Keywords

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc