Created
September 8, 2025 18:21
-
-
Save dontpaniclabsgists/c274a5d6977f5a913e86d3c2c1672656 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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