image_data = user.image.read() image_content = base64.encodestring(image_data) headers = {'Content-Type': 'application/json'} data = { "requests": [{ "image": { "content": image_content }, "features": [{ "type": "SAFE_SEARCH_DETECTION", "maxResults": 10 }] }] } results = urlfetch.fetch( url='https://vision.googleapis.com/v1/images:annotate?key='+GCP_API_KEY, headers=headers, payload=json.dumps(dat