emotion

package
v0.0.0-...-52824e0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2016 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	URL string = "https://api.projectoxford.ai/emotion/v1.0"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Emotion

type Emotion struct {
	BingKey       string
	LastRequestID string
}

func New

func New(key string) (*Emotion, error)

func (*Emotion) GetVideoResult

func (emotion *Emotion) GetVideoResult(id string) (VideoResult, error)

func (*Emotion) Recognize

func (emotion *Emotion) Recognize(url string) ([]EmotionDetail, error)

func (*Emotion) RecognizeFace

func (emotion *Emotion) RecognizeFace(url string, faceArr []Rectangle) ([]EmotionDetail, error)

type EmotionDetail

type EmotionDetail struct {
	FaceRectangle Rectangle `json:"faceRectangle"`
	Scores        Score     `json:"scores"`
}

type Error

type Error struct {
	Code    string `json:"statusCode"`
	Message string `json:"message"`
}

type Rectangle

type Rectangle struct {
	Top    int `json:"top"`
	Left   int `json:"left"`
	Width  int `json:"width"`
	Height int `json:"height"`
}

type Score

type Score struct {
	Anger     float64 `json:"anger"`
	Contempt  float64 `json:"contempt"`
	Disgust   float64 `json:"disgust"`
	Fear      float64 `json:"fear"`
	Happiness float64 `json:"happiness"`
	Neutral   float64 `json:"neutral"`
	Sadness   float64 `json:"sadness"`
	Surprise  float64 `json:"surprise"`
}

type VideoResult

type VideoResult struct {
	Status             string `json:"status"`
	CreatedDateTime    string `json:"createdDateTime"`
	LastActionDateTime string `json:"lastActionDateTime"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL