face_emotion: Detects face emotion

Description Usage Arguments Value See Also Examples

Description

Given a grayscale input image of a face, returns a probability distribution over emotional state. Input should be a two-dimensional structure (like data.frame or matrix), resizing will be attempted internally but for best performance, images should be already sized at 48x48 pixels.

Usage

1

Arguments

img

image data

version

for api version

...

additional arguments to passed to request

api_key

your personal indico API key

cloud

subdomain for indico private cloud

Value

List with face emotions probability pairs

See Also

facial_features, image_features

Examples

1
2
3
4
5
6
7
8
9
## Example 1
img <- "../tests/testthat/image/image.png"
emotion <- face_emotion(img)

most.possible <- sort(unlist(emotion), decreasing = TRUE)[1:2]
cat(sprintf("Detected '%s' emotion with probability %0.4f.\n",
            names(most.possible)[1], most.possible[1]))
cat(sprintf("Next possible is '%s' emotion with probability %0.4f.",
            names(most.possible)[2], most.possible[2]))

IndicoDataSolutions/IndicoIo-R documentation built on May 7, 2019, 6:37 a.m.