用于视频的Microsoft Emotion API

时间:2018-12-03 16:49:56

标签: python azure

您好,我试图制作将视频作为输入的python程序,然后使用Azure Microsoft情感IPA,然后将结果作为打印输出 我想知道应该将(Endpoint)或(emotion_recognition_url)放在哪里 以及如何从网址或PC(本地目录)中加载我的视频

import httplib, urllib, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '____ I puted my key here _____',
}

params = urllib.urlencode({
    # Request parameters
    'outputStyle': 'aggregate',
})

try:
    conn = httplib.HTTPSConnection('westus.api.cognitive.microsoft.com')
    conn.request("POST", "/emotion/v1.0/recognizeinvideo?%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

谢谢

0 个答案:

没有答案