Description Usage Arguments Value See Also Examples
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.
1 | face_emotion(img, version = NULL, ...)
|
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 |
List with face emotions probability pairs
facial_features
, image_features
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]))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.