<jupyter_start><jupyter_text>Vision<jupyter_code>image = 'shum.jpg'
img = Image.open(image)
display(img)
url = get_endpoints()['vision']
headers = {
    'Content-Type': 'application/octet-stream',
    'Ocp-Apim-Subscription-Key': keys['vision'],
}

params = {
    'visualFeatures': 'ImageType,Faces,Adult,Categories,Color,Tags,Description',
    'details': 'Celebrities,Landmarks',
    'language': 'en'
}
with open(image, 'rb') as f:
    r = requests.post(url, headers=headers, params=params, data=f)

response = r.json()
j = json.dumps(response, indent=2, sort_keys=True)
print(j)
im = draw_faces(img, response['faces'], response['description']['captions'][0]['text'])
display(im)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.18591549295774648, 'fraction_numerical': 0.0028169014084507044, 'mean_word_length': 6.813186813186813, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '21273', 'license': 'MIT', 'n_tokens_mistral': 261, 'n_tokens_neox': 258, 'n_words': 41, 'path': 'notebooks/vision.ipynb', 'repo_name': 'sethjuarez/AzureAIDemos', 'size': '710'}