Options
All
  • Public
  • Public/Protected
  • All
Menu

Emotion & Attention Classifiers

Realeyes' Web SDK for Emotion & Attention classifiers v4.3.

This Web SDK can be used to detect faces, facial landmarks, 7 basic emotions and attention from facial images, videos or webcam streams.

Demo

Obtaining SDK

Realeyes Web SDK is already available to selected partners. You can request your access to the SDK here:

ACCESS SDK

Once you obtain the SDK please make sure you serve the assets under dist/assets.

Minimal working example

// index.js

import re from "@realeyes/emotions";

await re.downloadModels({
    assetsRoot: "path/to/assets",
    modelNames: ["happy"],
});

const result = await re.predict({
    image: document.getElementById("img"),
    modelNames: ["happy"],
});

 

<!-- index.html -->

<img id="img" src="face.jpg" />
<script src="index.js"></script>

Sample results

{
    "face": true,
    "predictions": {
        "happy": {
            "modelName": "happy",
            "binary": true,
            "linear": 0.9788005948066711,
            "threshold": 0.8538524311488359,
        },
        "surprise": {
            "modelName": "surprise",
            "binary": false,
            "linear": 0.5066214203834534,
            "threshold": 0.9738524311488359,
        },
        // ...
    },
    "landmarks": [
        {
            "x": 101.58683249739155,
            "y": 95.09798135177391,
        },
        // ...
    ],
    "presence": true,
};

Getting Started

See Getting Started.

System Requirements

Supported Browsers

The following browsers are supported on mobile platforms:

  • Chrome (Android 6 or newer)
  • Safari (iOS 10 or newer)

The following browsers are supported on desktop platforms:

  • Chrome (54 or newer)
  • Safari (10.1 (Sierra) or newer)
  • Edge (15 or newer)
  • Firefox (50 or newer)
  • Opera (41 or newer)

Recommended Hardware Requirements

  • CPU: 3GHz
  • RAM: 16GB
  • GPU: 1.5GB

Reference

API Documentation