diff --git a/supervision/detection/core.py b/supervision/detection/core.py index 75fd0a9c..8d97bc03 100644 --- a/supervision/detection/core.py +++ b/supervision/detection/core.py @@ -525,6 +525,11 @@ class Detections: >>> detections = sv.Detections.from_azure_analyze_image(response) """ + if "error" in azure_result: + raise ValueError( + f'Azure API returned an error {azure_result["error"]["message"]}' + ) + xyxy, confidences, class_ids = [], [], [] is_dynamic_mapping = class_map is None