A jQuery/Zepto plugin to detect faces on images, videos and canvases to get theirs coordinates.
Importante note:This plugin uses an algorithm by Liu Liu .
Website and demo here:
http://facedetection.jaysalvat.com/
Download the plugin with the method of your choice.
Or install it with Bower .
bower install jquery.facedetection
Or install it with NPM .
npm install jquery.facedetection
Include jQuery and the plugin.
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script> <script src="path/to/dist/jquery.facedetection.min.js"></script>
Set a picture with some faces in your HTML page.
<img id="picture" src="img/face.jpg">
Apply the plugin to this image and get the face coordinates.
<script> $('#picture').faceDetection({ complete: function (faces) { console.log(faces); } }); </script>
Returns an array of found faces object:
complete— Callback function trigged after the detection is completed
complete: function (faces) { // ... }
error— Callback function trigged on errors
error: function (code, message) { // ... }