Detections represent bounding box, segmentation, or classification results.
Detections
class encapsulates a wide array of detection data. The class can represent bounding box, segmentation, and classification results.
DetectionType.BOUNDING_BOX
, DetectionType.SEGMENTATION
, or DetectionType.CLASSIFICATION
).[x1, y1, x2, y2]
for each detection, where (x1, y1) refers to the top left coordinate and (x2, y2) refers to the bottom right coordinate.classes
.class_ids
.Detections
object into a list of Detections
objects, each containing a single detection.Returns:List['Detections']
: A list of Detections objects, each containing a single detection.Detections
instance from a list of class namesParameters:assigned_classes
(List[str]
): The class name(s) that have been assigned to the classification detection.all_classes
(Optional[List[str]]
): List of strings representing all possible class names that can be assigned in the classification detection.Detections
: A classification Detections object.Detections
instance from a YOLOv5 inference result.Parameters:yolov5_results
(yolov5.models.common.Detections
): The output Detections instance from YOLOv5.Detections
: A bounding box Detections object.Detections
instance from an Ultralytics YOLOv8 inference result.Parameters:ultralytics_results
(ultralytics.yolo.engine.results.Results
): The output Results instance from YOLOv8.Detections
: A bounding box or segmentation Detections object.Detections
object.Returns:Detections
: An empty bounding box Detections object.Detections
instance to a supervision.Detections
instance.Returns:sv.Detections
: A supervision Detections instance.Detections
class, including creation, manipulation, and conversion of detection data.