GithubHelp home page GithubHelp logo

automata / ccv-purejs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from orls/ccv-purejs

0.0 2.0 0.0 138 KB

Pure-JS face detection; nodeified &npmified fork of liuliu's browser version https://github.com/liuliu/ccv/tree/current/js

JavaScript 100.00%

ccv-purejs's Introduction

#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://[email protected]/orls/ccv-purejs.git face-detect
$ cd face-detect
$ npm install
$ cd ../my-project
$ npm install ../face-detect

ccv-purejs's People

Contributors

automata avatar orls avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.