Skip to content

DavidPacioianu/Emotion-Analysis-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Emotion-Analysis-API

Android Arsenal Platform API GitHub license

Android Wrapper for the Microsoft Project Oxford Emotion API.

Download

In your gradle file Download

compile 'com.pacioianu.david:emotion-analysis-api:1.1.0'

Usage

First, init EmotionAnalysis in your application

  EmotionRestClient.init(context, <subscription_key>);

Asynchronous:

 EmotionRestClient.getInstance().detect(<your uri/url/bitmap>, new ResponseCallback() {
          @Override
          public void onError(String errorMessage) {
              Toast.makeText(context, errorMessage, Toast.LENGTH_LONG).show();
          }

          @Override
          public void onSuccess(FaceAnalysis[] response) {
              Toast.makeText(context, context.getString(R.string.successfully_analysed), Toast.LENGTH_LONG).show();
          }
      });

Synchronous:

 EmotionRestClient.getInstance().detect(<your uri/url/bitmap>);

Sample

Sample response

[
  {
    "faceRectangle": {
      "left": 523,
      "top": 293,
      "width": 522,
      "height": 522
    },
    "scores": {
      "anger": 0.231301255,
      "contempt": 0.00228384347,
      "disgust": 0.013675208,
      "fear": 0.0000379959965,
      "happiness": 0.000004979391,
      "neutral": 0.582898065,
      "sadness": 0.1897379,
      "surprise": 0.0000607591355
    }
  }
]

Apps using the Emotion API

(feel free to send me your project)

Icon Application
Facelyse

Community

Looking for contributors, feel free to fork !

Dependencies

Developed By

Author: David Pacioianu www.david.pacioianu.com/

License

Copyright 2016 David Păcioianu

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.