Socket
Book a DemoInstallSign in
Socket

@id3/facedetector

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@id3/facedetector

Detect and track faces in real-time from web camera and video stream

1.1.2
latest
Source
npmnpm
Version published
Weekly downloads
10
11.11%
Maintainers
2
Weekly downloads
 
Created
Source

Overview

facedetector is a javascript library for real-time face detection.

This library is based on the work of Martin Tschirsich's js-objectdetect.

Watch this video for a short demonstration.

facedetector is distributed under MIT license. The included *.js files are subject to their own licenses.

Functions

  • Multiple faces can be detected
  • Implemented a simple tracking algorithm

Example

Online realtime-face-detecting example here.
https://riversun.github.io/facedetector/example/index.html

Usage


var videoTag=document.getElementById("video");
var faceDetector = new FaceDetector(
      {
          video: videoTag,
          flipLeftRight: false,
          flipUpsideDown: false
      }
  );

  faceDetector.setOnFaceAddedCallback(function (addedFaces, detectedFaces) {
      for (var i = 0; i < addedFaces.length; i++) {
          console.log("[facedetector] New face detected id=" + addedFaces[i].faceId + " index=" + addedFaces[i].faceIndex);
      }
  });

  faceDetector.setOnFaceLostCallback(function (lostFaces, detectedFaces) {
      for (var i = 0; i < lostFaces.length; i++) {
          console.log("[facedetector] Face removed id=" + lostFaces[i].faceId + " index=" + lostFaces[i].faceIndex);
      }
  });

  faceDetector.setOnFaceUpdatedCallback(function (detectedFaces) {
      for (var i = 0; i < detectedFaces.length; i++) {
          var face = detectedFaces[i];
          console.log(face.faceId+" x="+face.x+" y="+face.y+" w="+ face.width+" h="+face.height );
      }
  });

  //after getUserMedia
  faceDetector.startDetecting();

  //to stop the process (to release resources)
  faceDetector.stop();

Run on node.js

You can import library with npm.

Install

npm install @id3/facedetector

Run on browser

Download actual files

<script src="FaceDetector.js"></script>

FAQs

Package last updated on 16 Jul 2019

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.