Socket
Socket
Sign inDemoInstall

face-detect

Package Overview
Dependencies
66
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    face-detect

A pure-JS facial detection library


Version published
Weekly downloads
6
increased by20%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

#Face detection js

A fork of the pure-javascript face detection in Liu Liu's CCV library (in branch 'current'), converted for Node and npm.

Usage

This package provides the method detect_objects, to which you pass a parameters hash. The most important parameter is the canvas obj, into which you should have already loaded an image.

This method returns an array of hashes, each representing a face, with the following fields:

  • x, y : the coordinates of the top-left corner of the face's bounding box
  • width, height : the pixel dimensions of the face's bounding box
  • neighbours, confidence : info from the detection algorithm

Simple example

var face_detect = require('face-detect'),
    Canvas = require('canvas');

// ... initialize a canvas object ...

var result = face_detect.detect_objects({ "canvas" : myCanvas,
  "interval" : 5,
  "min_neighbors" : 1 });

console.log('Found ' + result.length  + ' faces.');

for (var i = 0; i < result.length; i++){
  var face =  result[i];
  console.log(face);
}

in future, directly passing an image path or a buffer containing raw png data will be supported

Credits

It's important to note that this is not my work. All credit for the actual face-detection work should go to Liu Liu.

I have just taken the browser JS from that project (in branch current ), plucked out the threading support and made it useable with node & npm via node-canvas

Install

This project is installed with npm.

from npm repository

$cd my-project
$ npm install face-detect

locally with npm

$ git clone https://orls@github.com/orls/ccv-purejs.git face-detect
$ cd face-detect
$ npm install
$ cd ../my-project
$ npm install ../face-detect

Keywords

FAQs

Last updated on 12 May 2015

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc