title: How to detect emotions with Azure API?
body: <p>I'd like to create a simple Python app recognizing face emotions from given URL via Azure Face/Emotions API.
  I'm following this documentation:</p>
  
  <ul>
  <li><a href="https://docs.microsoft.com/en-us/azure/cognitive-services/face/quickstarts/python-sdk#authenticate-the-client" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/cognitive-services/face/quickstarts/python-sdk#authenticate-the-client</a></li>
  <li><a href="https://docs.microsoft.com/en-us/python/api/azure-cognitiveservices-vision-face/azure.cognitiveservices.vision.face.models.emotion?view=azure-python" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/python/api/azure-cognitiveservices-vision-face/azure.cognitiveservices.vision.face.models.emotion?view=azure-python</a></li>
  </ul>
  
  <p>So, far, I did the face recognition part, but I'm kinda stuck how to call the Emotion model and display results.</p>
  
  <pre><code>import urllib.request  
  from azure.cognitiveservices.vision.face import FaceClient
  from azure.cognitiveservices.vision.face.models import Emotion
  from msrest.authentication import CognitiveServicesCredentials
  
  # Image
  URL = "https://upload.wikimedia.org/wikipedia/commons/5/55/Dalailama1_20121014_4639.jpg"
  
  # API
  KEY = "xxx"
  ENDPOINT = "https://happyai.cognitiveservices.azure.com/"
  
  # Now there is a trained endpoint that can be used to make a prediction
  predictor = FaceClient(ENDPOINT, CognitiveServicesCredentials(KEY))
  
  detected_faces = predictor.face.detect_with_url(url=URL)
  if not detected_faces:
      raise Exception('No face detected from image {}'.format(URL))
  
  # Display the detected face ID in the first single-face image.
  # Face IDs are used for comparison to faces (their IDs) detected in other images.
  print('Detected face ID from', URL, ':')
  for face in detected_faces: print (face.face_id)
  print()
  
  # Save this ID for use in Find Similar
  first_image_face_ID = detected_faces[0].face_id
  
  # Call Emotion model
  
  # Display the results.
  </code></pre>
  
  <p>Any help would be greatly appreciated.
  Thanks!</p>