先日 Cogbot 勉強会に行った日に試したメモ
あとでもう少し真面目に書く
$EMOTION_API_KEY = '<Your API KEY>'
$URL = 'https://api.projectoxford.ai/emotion/v1.0/recognize'
$image = 'C:\Users\hoge\Desktop\1.jpg'
$result = Invoke-RestMethod `
-Uri $URL `
-Method Post `
-ContentType 'application/octet-stream' `
-Headers @{'Ocp-Apim-Subscription-Key' = $EMOTION_API_KEY } `
-InFile $image
$result | format-list *
faceRectangle : @{height=301; left=773; top=413; width=301}
scores : @{anger=3.39188122E-10; contempt=6.80944259E-11; disgust=1.14517213E-08; fear=3.75176244E-11; happiness=1.
0; neutral=8.258468E-10; sadness=2.64461564E-09; surprise=7.739051E-09}
faceRectangle : @{height=260; left=1304; top=502; width=260}
scores : @{anger=1.08654437E-08; contempt=0.000370971655; disgust=3.1528856E-07; fear=3.752806E-09; happiness=0.990
0218; neutral=0.009603429; sadness=3.0391775E-06; surprise=4.06609132E-07}