Нет текущего примера кода R в документации FACE API.Однако решение состоит в том, чтобы изменить URL-адрес на:
faceURL <- 'https://westcentralus.api.cognitive.microsoft.com/face/v1.0/detect?returnFaceId=true&returnFaceLandmarks=true&returnFaceAttributes=age,gender,headPose,smile,facialHair,glasses,emotion,hair,makeup,occlusion,accessories,blur,exposure,noise'
и после анализа:
outcome = httr::content(faceResponse)[[1]]
names(outcome)
[1] "faceId" "faceRectangle" "faceLandmarks" "faceAttributes"
и, наконец, мы получили:
> content(faceResponse)
[[1]]
[[1]]$`faceId`
[1] "XXX"
[[1]]$faceRectangle
[[1]]$faceRectangle$`top`
[1] 80
[[1]]$faceRectangle$left
[1] 221
[[1]]$faceRectangle$width
[1] 147
[[1]]$faceRectangle$height
[1] 147
[[1]]$faceLandmarks
[[1]]$faceLandmarks$`pupilLeft`
[[1]]$faceLandmarks$`pupilLeft`$`x`
[1] 264.7
[[1]]$faceLandmarks$`pupilLeft`$y
[1] 122.4
[[1]]$faceLandmarks$pupilRight
[[1]]$faceLandmarks$pupilRight$`x`
[1] 330.8
[[1]]$faceLandmarks$pupilRight$y
[1] 119.9
[[1]]$faceLandmarks$noseTip
[[1]]$faceLandmarks$noseTip$`x`
[1] 285.3
...