aci-demos
aci-demos copied to clipboard
implement captionbot
https://github.com/dylang/captionbot spin off containers to caption each picture w/ a face and then post them on twitter and then delete the container
actually gonna try MS cognitive services 4 this
import http.client, urllib.request, urllib.parse, urllib.error, base64
headers = { # Request headers 'Content-Type': 'application/json', 'Ocp-Apim-Subscription-Key': '{subscription key}', }
params = urllib.parse.urlencode({ # Request parameters 'visualFeatures': 'Categories', 'details': '{string}', 'language': 'en', })
try: conn = http.client.HTTPSConnection('westus.api.cognitive.microsoft.com') conn.request("POST", "/vision/v1.0/analyze?%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))