Skip to content

jimbog/pico.js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PICO Face Detector

A library for detecting faces using the PICO algorithm with the face rotation invariant implementation.

Usage

An example of using the basic functions of the library:

// load cascade
fetch('./data/faces.dat')
  .then(function(response) {
    if (!response.ok) throw Error(response.statusText || 'Request error');
    return response.arrayBuffer();
  })
  .then(function(cascade) {
    // create PICO detector with options
    return PICO(cascade, {
      shiftfactor: 0.1, // move the detection window by 10% of its size
      scalefactor: 1.1, // resize the detection window by 10% when moving to the higher scale
      initialsize: 0.1, // minimum size of a face (10% of image area)
      rotation: [0, 30, 60, 90, 270, 300, 330], // rotation angles in degrees
      threshold: 0.2, // overlap threshold
      memory: 3 // number of images in the memory
    });
  })
  .then(function(detect) {
    // image = ImageData
    return detect(image);
  })
  .then(function(dets) {
    // dets = [{ r: rows, c: cols, s: size, q: quality, a: angle }]
    console.log(dets);
  });

Run demo

Run the dev server:

npm install
npm start

And open the link in your browser http://localhost:3000

pico.js

Related projects

About

A library for detecting faces using the PICO algorithm

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 32.8%
  • JavaScript 30.8%
  • HTML 22.2%
  • Python 7.6%
  • C++ 5.7%
  • CMake 0.7%
  • Makefile 0.2%