All Projects → jeeliz → jeelizGlanceTracker

jeeliz / jeelizGlanceTracker

Licence: Apache-2.0 license
JavaScript/WebGL lib: detect if the user is looking at the screen or not from the webcam video feed. Lightweight and robust to all lighting conditions. Great for play/pause videos if the user is looking or not, or for person detection. Link to live demo.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to jeelizGlanceTracker

ARFaceFilter
Javascript/WebGL lightweight face tracking library designed for augmented reality webcam filters. Features : multiple faces detection, rotation, mouth opening. Various integration examples are provided (Three.js, Babylon.js, FaceSwap, Canvas2D, CSS3D...).
Stars: ✭ 72 (+5.88%)
Mutual labels:  detection, face, face-detection, webcam, face-tracking
Jeelizweboji
JavaScript/WebGL real-time face tracking and expression detection library. Build your own emoticons animated in real time in the browser! SVG and THREE.js integration demos are provided.
Stars: ✭ 835 (+1127.94%)
Mutual labels:  real-time, face, face-detection, webcam, face-tracking
Jeelizfacefilter
Javascript/WebGL lightweight face tracking library designed for augmented reality webcam filters. Features : multiple faces detection, rotation, mouth opening. Various integration examples are provided (Three.js, Babylon.js, FaceSwap, Canvas2D, CSS3D...).
Stars: ✭ 2,042 (+2902.94%)
Mutual labels:  lightweight, detection, face, face-detection, face-tracking
brfv4 win examples
Windows C++ examples utilizing OpenCV for camera access and drawing the face tracking results.
Stars: ✭ 13 (-80.88%)
Mutual labels:  detection, face, face-detection, face-tracking
Brfv4 javascript examples
BRFv4 - HTML5/Javascript - examples project. Reference implementation for all other platform example packages.
Stars: ✭ 460 (+576.47%)
Mutual labels:  detection, face, face-detection, face-tracking
jeelizPupillometry
Real-time pupillometry in the web browser using a 4K webcam video feed processed by this WebGL/Javascript library. 2 demo experiments are included.
Stars: ✭ 78 (+14.71%)
Mutual labels:  real-time, detection, face, webcam
brfv4 android examples
Android Studio project (Java)
Stars: ✭ 43 (-36.76%)
Mutual labels:  detection, face, face-detection, face-tracking
Extd pytorch
Official EXTD Pytorch code
Stars: ✭ 177 (+160.29%)
Mutual labels:  lightweight, detection, face-detection
Brfv4 mac examples
macOS C++ examples utilizing OpenCV for camera access and drawing the face tracking results.
Stars: ✭ 25 (-63.24%)
Mutual labels:  face, face-detection, face-tracking
Facelandmarksdetection
Finds facial features such as face contour, eyes, mouth and nose in an image.
Stars: ✭ 130 (+91.18%)
Mutual labels:  face, face-detection, face-tracking
Dockerface
Face detection using deep learning.
Stars: ✭ 173 (+154.41%)
Mutual labels:  detection, face, face-detection
Sod
An Embedded Computer Vision & Machine Learning Library (CPU Optimized & IoT Capable)
Stars: ✭ 1,460 (+2047.06%)
Mutual labels:  real-time, detection, face-detection
Facekit
Implementations of PCN (an accurate real-time rotation-invariant face detector) and other face-related algorithms
Stars: ✭ 1,028 (+1411.76%)
Mutual labels:  real-time, face-detection, face-tracking
timeline
Timeline - A photo organizer
Stars: ✭ 39 (-42.65%)
Mutual labels:  detection, face, face-detection
morghulis
No description or website provided.
Stars: ✭ 18 (-73.53%)
Mutual labels:  face, face-detection
etos-facedetector
Simple and Effective Face Detector, based on Progressive Calibration Networks (PCN) which is an accurate rotation-invariant face detector running at real-time speed on CPU, published in CVPR 2018.
Stars: ✭ 23 (-66.18%)
Mutual labels:  face-detector, face-detection
FaceIDLight
A lightweight face-recognition toolbox and pipeline based on tensorflow-lite
Stars: ✭ 17 (-75%)
Mutual labels:  face, face-detection
quickstart-android
Quick start examples for Banuba Face AR SDK on Android
Stars: ✭ 17 (-75%)
Mutual labels:  face-detection, face-tracking
FXFaceDetection
Real-Time Face Detection App using Computer Vision & JavaFX
Stars: ✭ 50 (-26.47%)
Mutual labels:  face-detection, face-tracking
GenderRecognizer
Plain Face Detector & Gender Recognizer
Stars: ✭ 57 (-16.18%)
Mutual labels:  face-detector, face-detection

Jeeliz Glance Tracker

This JavaScript/WebGL library detects if the user is looking at the screen or not. It is very robust to all lighting conditions and lightweight (only 150KB gzipped for the main script and the neural network JSON model). It is great for playing a video only if the user is watching it.

Demos

You can test it with these demos (included in this repo):

This is a video screenshot of the Youtube integration demo:

Architecture

This repository is composed of the following paths:

  • /dist/: Main library script and neural network model,
  • /demos/: Integration demonstrations,
  • /libs/: third party library.

Integration

In the HTML page, you first need to include the main script between the tags <head> and </head>:

 <script src="dist/jeelizGlanceTracker.js"></script>

Then you should include a <canvas> HTML element in the DOM, between the tags <body> and </body>:

<canvas id='glanceTrackerCanvas'></canvas>

This canvas will be used by WebGL for the computation and the display of the camera video with the face detection frame. It can be hidden using CSS rules. As soon as the page is loaded or when you want to enable the glance tracking feature you should call this function:

JEELIZGLANCETRACKER.init({
  // MANDATORY:
  // callback launched when:
  //  * the user is watching (isWatching=true) 
  //  * or when he stops watching (isWatching=false)
  // it can be used to play/pause a video
  callbackTrack: function(isWatching){
    if (isWatching){
      console.log('Hey, you are watching bro');
    } else {
      console.log('You are not watching anymore :(');
    }
  },

  // FACULTATIVE (default: none):
  // callback launched when then Jeeliz Glance Tracker is ready
  // or if there was an error
  // spec is an object with these attributes:
  //   * <video> video: the video element
  //   * <WebGLContext> GL: the webgl context
  //   * <WebGLTexture> videoTexture: WebGL texture storing the camera video
  //   * <WebGLTexture> videoTextureCut: WebGL texture storing the cropped face
  callbackReady: function(error, spec){
    if (error){
      console.log('EN ERROR happens', error);
      return;
    }
    console.log('All is well :)');
  },

  //FACULTATIVE (default: true):
  //true if we display the video of the user
  //with the face detection area on the <canvas> element
  isDisplayVideo: true,

  // MANDATORY:
  // id of the <canvas> HTML element
  canvasId: 'glanceTrackerCanvas',

  // FACULTATIVE (default: internal)
  // sensibility to the head vertical axis rotation
  // float between 0 and 1: 
  // * if 0, very sensitive, the user is considered as not watching
  //   if he slightly turns his head,
  // * if 1, not very sensitive: the user has to turn the head a lot
  //   to loose the detection. 
  sensibility: 0.5,

  // FACULTATIVE (default: current directory)
  // should be given without the NNC.json
  // and ending by /
  // for example ../../
  NNCPath: '/path/of/NNC.json'
});

Other methods

After the initialization, these methods are available:

  • JEELIZGLANCETRACKER.set_sensibility(<float> sensibility): adjust the sensibility (between 0 and 1),

  • JEELIZGLANCETRACKER.toggle_pause(<boolean> isPause, <boolean> shutCamera): pause/resume the face tracking. if shutCamera is set to true, it will also turn off the camera light. It returns a promise,

  • JEELIZGLANCETRACKER.toggle_display(<boolean> isDisplay): toggle the display of the video with the face detection area on the HTML <canvas> element. It is better to disable the display if the canvas element is hidden (using CSS for example). It will save some GPU resources.

  • JEELIZGLANCETRACKER.destroy(): Clean both graphic memory and JavaScript memory, uninit the library. After that you need to init the library again.

You should use them after initialization, ie:

  • either after that callbackReady function provided as initialization argument is launched (better),
  • or when the boolean property JEELIZGLANCETRACKER.ready switches to true.

Hosting

HTTPS only!

The tracker requires the user's camera video feed through MediaStream API. So your application should be hosted with a HTTPS server (even with a self-signed certificate). It won't work at all with unsecure HTTP, even locally with some web browsers.

The scripts

You can use our hosted and up to date version of the library, available here:

https://appstatic.jeeliz.com/glanceTracker/jeelizGlanceTracker.js

It is hosted on a content delivery network (CDN) using gzip compression. If you host the scripts by yourself, be careful to enable gzip HTTP/HTTPS compression for .JSON and .JS files. Indeed, the neuron network JSON file, dist/NNC.json is quite heavy, but very well compressed with GZIP. You can check the gzip compression of your server here.

About the tech

Under the hood

This API uses Jeeliz WebGL Deep Learning technology to detect and track the user's face using a neural network. All is done client-side.

Compatibility

  • If WebGL2 is available, it uses WebGL2 and no specific extension is required,
  • If WebGL2 is not available but WebGL1, we require either OES_TEXTURE_FLOAT extension or OES_TEXTURE_HALF_FLOAT extension,
  • If WebGL2 is not available, and if WebGL1 is not available or neither OES_TEXTURE_FLOAT or OES_HALF_TEXTURE_FLOAT are implemented, the user is not compatible.

In all cases, WebRTC should be implemented in the web browser, otherwise FaceFilter API will not be able to get the camera video feed. Here are the compatibility tables from caniuse.com here: WebGL1, WebGL2, WebRTC.

If a compatibility error is triggered, please post an issue on this repository. If this is a problem with the camera access, please first retry after closing all applications which could use your device (Skype, Messenger, other browser tabs and windows, ...). Please include:

License

Apache 2.0. This application is free for both commercial and non-commercial use.

References

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].