diff --git a/supervision/detection/core.py b/supervision/detection/core.py index f7f1bb5f..3b64c6ae 100644 --- a/supervision/detection/core.py +++ b/supervision/detection/core.py @@ -432,7 +432,7 @@ class Detections: ) @classmethod - def from_roboflow(cls, roboflow_result: dict, class_list: List[str]) -> Detections: + def from_roboflow(cls, roboflow_result: dict) -> Detections: """ Create a Detections object from the [Roboflow](https://roboflow.com/) API inference result. @@ -440,8 +440,6 @@ class Detections: Args: roboflow_result (dict): The result from the Roboflow API containing predictions. - class_list (List[str]): A list of class names - corresponding to the class IDs in the API result. Returns: (Detections): A Detections object containing the bounding boxes, class IDs, @@ -464,13 +462,12 @@ class Detections: ... # ... more predictions ... ... ] ... } - >>> class_list = ["person", "car", "dog"] - >>> detections = sv.Detections.from_roboflow(roboflow_result, class_list) + >>> detections = sv.Detections.from_roboflow(roboflow_result) ``` """ xyxy, confidence, class_id, masks = process_roboflow_result( - roboflow_result=roboflow_result, class_list=class_list + roboflow_result=roboflow_result ) if np.asarray(xyxy).shape[0] == 0: