官术网_书友最值得收藏!

Retrieving more information from the detected faces

In Chapter 1, Getting Started with Microsoft Cognitive Services, we learned the very basic form of face detection. In the example, we retrieved a Face array. This contained information on all faces that were found in an image. In that specific example, we obtained information about the face rectangle, face ID, face landmarks, and age.

When calling the API, there are four request parameters, as shown in the following table:

        

      
              
Parameter           Description
image
  • The image in which to search for faces. It will either be in the form of a URL or binary data.
  • Supported formats are JPEG, PNG, GIF, and BMP.
  • The maximum file size is 4 MB.
  • The size of detectable faces is between 36 x 36 pixels and 4096 x 4096 pixels.
    
              
return FaceId (optional)           Boolean value. This specifies whether the response should include the face ID or not.
return FaceLandmarks (optional)           Boolean value. This specifies whether the response should include FaceLandmarks in detected faces.
return FaceAttributes (optional)
  • String value. This is a comma-separated string containing all face attributes that are to be analyzed.
  • Supported attributes are age, gender, head pose, smile, facial hair, emotion, and glasses.
  • These attributes are still experimental, and should be treated as such.
            
      

If a face is successfully discovered, it will expire in 24 hours. When calling other parts of the Face API, you are often required to have a face ID as an input. In those cases, we need to detect a face first, followed by the call to the API we wish to use, using the detected face as a parameter.

Using this knowledge, I challenge you to play around with the example in Chapter 1, Getting Started with Microsoft Cognitive Services. Draw a rectangle around the face. Mark the eyes in the image.

主站蜘蛛池模板: 福贡县| 登封市| 郯城县| 奎屯市| 鹿泉市| 云霄县| 鄂伦春自治旗| 波密县| 罗定市| 双城市| 孟州市| 林周县| 藁城市| 上饶县| 麻江县| 张家口市| 南木林县| 普兰店市| 徐闻县| 永昌县| 霍林郭勒市| 深泽县| 资中县| 蒙城县| 河北区| 神农架林区| 汤阴县| 大荔县| 临猗县| 金乡县| 乌兰县| 澳门| 铜陵市| 阳江市| 阿图什市| 德江县| 漯河市| 长海县| 宝应县| 扎兰屯市| 镇江市|