DetectionResult
class¶
DetectionResult
¶
Detection result model for YOLOv8 or MCCDetector card and color patches detection.
A data model that encapsulates YOLOv8 detection or MCCDetector results for a standardized color card and its color patches. The model handles two distinct classes: patches (label 0) and card (label 1). In a typical detection scenario, the model captures one card and 24 color patches inside/outside the card.
Notes
The detection typically yields 25 objects:
- 1 color checker card 24 Patches (class_id: 1)
- 24 color patches (class_id: 0)
Attributes:
Name | Type | Description |
---|---|---|
boxes |
list[tuple[int, int, int, int]] | None
|
List of bounding boxes for detected objects. List of bounding boxes as (x1, y1, x2, y2). Representing the top-left and bottom-right corners of the detection. if not None, the boxes are not used. it means coming from Object Detection. Class identifiers for each detected object where:
|
segment |
list[SegmentPoint] | None
|
List of segmentation points for detected objects. Each point is represented as a tuple of (x, y) coordinates. [[x1, y1], [x2, y2], [x3, y3], [x4, y4], [x1, y1]] for each patch. The last point is a repeat of the first to close the polygon. if not None, the segment is not used. it means coming from MCCDetector. |
scores |
list[float]
|
List of confidence scores for each detection. |
class_ids |
list[int]
|
List of class IDs corresponding to each detection. |
Source code in color_correction/schemas/det_yv8.py
Functions¶
draw_detections
¶
Draw detection boxes on the provided image.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image
|
numpy.ndarray
|
The image on which the detection boxes will be drawn. |
required |
Returns:
Type | Description |
---|---|
numpy.ndarray
|
The image with the drawn detection boxes. |