Skip to content

Instantly share code, notes, and snippets.

@dontpaniclabsgists
Created September 8, 2025 18:21
Show Gist options
  • Select an option

  • Save dontpaniclabsgists/c274a5d6977f5a913e86d3c2c1672656 to your computer and use it in GitHub Desktop.

Select an option

Save dontpaniclabsgists/c274a5d6977f5a913e86d3c2c1672656 to your computer and use it in GitHub Desktop.
# This worked almost immediately
def _call_analyze_api(self, image_data: bytes) -> Dict[str, Any]:
headers = {
'Ocp-Apim-Subscription-Key': AZURE_VISION_API_KEY,
'Content-Type': 'application/octet-stream'
}
params = {
'features': 'tags,objects,faces,brands,landmarks,celebrities,categories,description,adult,color,imageType',
'model-version': 'latest'
}
response = requests.post(
f"{AZURE_VISION_ENDPOINT}/vision/v3.2/analyze",
headers=headers,
params=params,
data=image_data
)
return response.json()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment