Skip to content

Commit

Permalink
Update vector_loves_azure.py
Browse files Browse the repository at this point in the history
added a comment for Azure subscription URL and removed unneeded imports.
  • Loading branch information
hassanhabib committed Dec 31, 2018
1 parent 4730554 commit e4ce5e7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vector_loves_azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

import anki_vector
import requests
import random
import string
import os

def identify_image(image, image_id):
Expand All @@ -21,6 +19,8 @@ def identify_image(image, image_id):
image.save(filename)
fin = open(filename, 'rb')
data = fin.read()
# Make sure the url we are calling below corresponds to your Azure subscription
# see this issue for more info (https://github.com/hassanhabib/anki_robot_with_azure/issues/1)
response = requests.post('https://westcentralus.api.cognitive.microsoft.com/vision/v2.0/analyze', headers=headers, params=params, data=data)
seen = response.json()['description']['captions'][0]['text']
print(seen)
Expand Down

0 comments on commit e4ce5e7

Please sign in to comment.