Giter VIP home page Giter VIP logo

ai-sdk-js's Introduction

MorphCast AI SDK for HTML5

MorphCast SDK is a native JavaScript engine for Real-Time Face Analysis, based on Deep Neural Networks.

It works directly in the web-browser of mobile and desktop platforms.

User's face is analyzed through the input camera device, at an average speed rate of 10 times per second on a mobile device, and even up to 30 per second on desktop. Output results are returned as ready-to-use events, with data already filtered for your convenience.

Use cases

You can easily add an emotion and demographic analysis layer to your website, landing page or App, creating exciting, adaptive digital experiences. MorphCast is being used across digital campaigns, corporate learning, eLearning, e-commerce, digital out-of-home and many other uses.

You can store all data produced in local memory, in local storage or properly send it to your server.

Quick Start

Copy and paste the following code snippet inside the body of an HTML page, or fork this JSFiddle.

<body>
...
<script src="https://ai-sdk.morphcast.com/v1.16/ai-sdk.js"></script>
<script>
CY.loader()
  .licenseKey("insert-here-your-license-key")
  .addModule(CY.modules().FACE_EMOTION.name)
  .load()
  .then(({ start, stop }) => start());

window.addEventListener(CY.modules().FACE_EMOTION.eventName, (evt) => {
  console.log('Face emotion result', evt.detail);
});
</script>
...
</body>

Generate now your license key here.

You shall serve the web page file using a web server, remote or local (e.g. http://localhost).

Since camera access requires https, when using a private network ip (e.g. https://192.168.x.x) or a public domain, you shall enable SSL in your web server configuration.

The SDK will automatically open and manage a camera stream internally, as well as the browser camera request.

Links:

Available Modules

Here, a list of available modules:

  • FACE_DETECTOR
  • FACE_POSE
  • FACE_AGE
  • FACE_EMOTION
  • FACE_GENDER
  • FACE_FEATURES
  • FACE_AROUSAL_VALENCE
  • FACE_ATTENTION
  • FACE_WISH

You can combine them as you like, e.g. to load FACE_DETECTOR and FACE_AGE:

loader = CY.loader()

      .addModule(CY.modules().FACE_DETECTOR.name, {})
      .addModule(CY.modules().FACE_AGE.name, {})

You can find the complete documentation, here.

Requirements

Minimum Reccomended:

  • Wasm Support
  • Javascript Enabled Browser
  • Updated Browser and OS:
    • Chrome 67+ for Android 5+, or Windows 7+, macOS 10.10+, Linux Ubuntu 14.04+, Debian 8+, openSUSE 13.3+, or Fedora Linux 24+
    • Safari 11.3+ for iOS 11.3+, or macOS 10.12+
    • Firefox 63+ for Windows 7+, macOS 10.9+, Linux (GTK+ 3.4, GLib 2.22, Pango 1.22, X.Org 1.0, libstdc++ 4.6.1)
    • Edge 16+ for Windows 10+

KNOWN DEVICE ISSUES:

  • iOS up to version iOS 11 doesn't support GetUserMedia.
  • iOS up to version iOS 11.3 doesn't support the needed Wasm features.
  • Micorosoft Edge up to version 16 doesn't support Wasm.
  • Microsft Internet Explorer is not supported.
  • Opera mini is not supported.

ai-sdk-js's People

Contributors

belalessandro avatar morphcast-sdk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.