Face Sentiment Api


Face Sentiment api allow you to detect sentiment of person within the image. Along with sentiment other characteristics like Age , Face Cordinate , Gender , Emotion , Race

Facial Sentiment

Endpoint

POST - /ml/face-sentiment

Parameters

  • file

    • required
    • Type: Image File
    • Size: Max File Size Allowed 20MB
    • Details: pass the string text you want to analyze for sentiment.
  • full

    • optional
    • Type: only Allowed Value is true
    • Details: Pass this params will add details data for emotion and race.

Example

Sample Image used

detection-demo image

Request

curl --form "file=@happy-face.jpg" $BASE_ROUTE/ml/face-sentiment

Response

{
  "data": {
    "age": 25,
    "face_region": {
      "h": 89,
      "w": 89,
      "x": 1087,
      "y": 375
    },
    "gender": "Man",
    "major_emotion": "sad",
    "major_race": "white"
  },
  "status": "done"
}
{
  "data": {
    "age": 25,
    "emotion": {
      "angry": 0.541308,
      "disgust": 0.000095,
      "fear": 0.006898,
      "happy": 0.040186,
      "neutral": 0.001107,
      "sad": 99.410409,
      "surprise": 0
    },
    "face_region": {
      "h": 89,
      "w": 89,
      "x": 1087,
      "y": 375
    },
    "gender": "Man",
    "major_emotion": "sad",
    "major_race": "white",
    "race": {
      "asian": 0.083637,
      "black": 0.000109,
      "indian": 0.009359,
      "latino hispanic": 0.027481,
      "middle eastern": 0.157583,
      "white": 99.721831
    }
  },
  "status": "done"
}
Contributors: coder9118