mmkamani7 / emotion-api-python

Python class to access Affectiva's Emotion as a Service API

Home Page:https://affectiva.readme.io/docs/getting-started-with-the-emotion-sdk-for-the-cloud

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python Utils for Affectiva Emotion API

This is a python library to communicate with the Affectiva Emotion API service to process videos and images. For more information, visit Affectiva's Developer Portal.

Build Status

Dependencies

  • Python 2.7
  • requests

Installation

pip install AffectivaEmotionAPI

Usage

Sign up for credentials

http://developer.affectiva.com/apioverview/

Upload an image or a video for processing

import affectiva.api
username = 'API_USER'
passwd = 'API_PASSWD'
api = affectiva.api.EmotionAPI(username,passwd)

# Upload a file for Processing
filename = 'test_file.mp4'
job_url = api.create_job(filename)['self']

Get face detection and emotion results

job_status = api.query_job(job_url)['status']

if status == 'done':
  metrics_json = api.results(job_url)

Uploading to PyPI

Increment the version in setup.py

rm dist/*.tar.gz
python setup.py sdist
twine upload dist/*

About

Python class to access Affectiva's Emotion as a Service API

https://affectiva.readme.io/docs/getting-started-with-the-emotion-sdk-for-the-cloud

License:MIT License


Languages

Language:Python 100.0%