顯示具有 Build Live Emotions Capture App 標籤的文章。 顯示所有文章
顯示具有 Build Live Emotions Capture App 標籤的文章。 顯示所有文章

2016年4月13日 星期三

Construct Reside Feelings Seize App Utilizing Feelings API (Half II)

Build Live Emotions Capture App Using Emotions API (Part II)

Aloha to the last part of the series. I hope you’re prepared with the improvement surroundings. You recognize, secret Santa informed me that you’re very excited to leap in and construct the app.

On this article we’ll check out HTML5’s cool options resembling getUserMedia(), canvas and changing canvas paint into BLOB and for the sake of simplicity and lucid writing, I’ve divided the code right into a small chunk.

Primary HTML markup (index.html)

<!DOCTYPE html>
<html>
<head>
  <hyperlink href="type.css" rel="stylesheet" sort="textual content/css" />
  <title>Feelings API Demo</title>
</head>
<physique>
  ...
  ...
  ...
  <video width="70%" autoplay></video>
  <canvas id="canvas" width="200" peak="200"></canvas>
  <span id="seize-button">Seize</span>
  <span id="use-this">Use this</span>
  ...
  ...
  ...
<script src="lib/jquery-2.1.four.js"></script>
<script src="script.js"></script>
</physique>
</html>

Primary CSS styling (fashion.css)

video, canvas 
  background: #f9f9f9;
  border: strong 1px #f1f1f1;
  border-radius: 3px;
  margin: 20px zero;

span 
  show: inline-block;
  background: tomato;
  padding: 10px;
  margin: 20px zero;
  shade: #fff;
  border-radius: 3px;
  cursor: pointer;
  -webkit-consumer-choose: none; 
  -moz-consumer-choose: none;

JavaScript (script.js)

1. getUserMedia() technique

The primary activity is to examine getUserMedia() technique in numerous browsers and normalize it by storing it within the navigator.getUserMedia.

// examine the varied vendor prefixed variations
    navigator.mozGetUserMedia activity is to examine whether or not it's supported on that browser or not. For this, we'll use a easy if-else situation. Whether it is supported then we'll proceed, in any other case an alert message will seem. As per the MDN, the browser compatibility with getUserMedia() is sweet with the seller prefix.

// Verify that the browser helps getUserMedia.
// If it does not present an alert, in any other case proceed.
if (navigator.getUserMedia) 
//code will go right here

else 
    alert('Sorry, your browser doesn't help getUserMedia');



Word: On the time of
The post Construct Reside Feelings Seize App Utilizing Feelings API (Half II) appeared first on DICKLEUNG DESIGN GROUP.

2016年4月12日 星期二

Construct Reside Feelings Seize App Utilizing Feelings API (Half I)

Build Live Emotions Capture App Using Emotions API (Part I)

A number of months in the past, I stumbled upon the API treasure of Microsoft. It was a jaw dropping second once I noticed greater than a dozen Synthetic Intelligence based mostly APIs. This treasure has a sci-fi identify and is called Venture Oxford which was introduced in Construct 2015 developer convention in San Francisco.

What’s Venture Oxford?

As said on Microsoft’s weblog – ‘Challenge Oxford helps developer to construct extra clever apps’. This challenge was developed to offer the developer some complicated machine studying that’s in any other case not potential for a single developer to construct because of time and useful resource constraints. These APIs will add extra enjoyable and the wow issue to an app that wasn’t straightforward earlier than.

The bunch of APIs is presently out there for restricted free utilization in beta stage. It has a restricted variety of API calls per thirty days, particularly starting from 5k to 10k calls.

A two-article collection will cowl all of the fundamentals of Venture Oxford and Feelings API. On this very first article, we’ll kick-begin with creating an account, code of conduct for builders, our challenge construction and so forth.

What has Microsoft cooked for you?

Microsoft supplies providers underneath three broad classes specifically Imaginative and prescient, Speech and language. We’ll style solely the Feelings API which comes underneath the Imaginative and prescient class.

What are we constructing? One other AlphaGo?

Completely not. My purpose is to construct an internet app which can take consumer’s pictures from the online digital camera and provides stay feelings because the end result. The great half is that we’ll accomplish this objective purely utilizing shopper-aspect. So, the JavaScript and jQuery shall be used all through the challenge. Be able to dive into JavaScript jargon.

We’ll seize photographs of the consumer utilizing a cool HTML5 function referred to as getUserMedia(). Sadly, Google does not honor this cool function with out the safe connection. So, notice that this hosted

The post Construct Reside Feelings Seize App Utilizing Feelings API (Half I) appeared first on DICKLEUNG DESIGN GROUP.