Update core.py

remoed class_list arg from core.py file
This commit is contained in:
Akash A Desai authored and GitHub committed 2023-10-03 21:41:13 +05:30
1 parent 6f30c87612
commit 4f513ce275
1 file changed
+3 -6
+3 -6
View File
@@ -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: