deepness.processing.models.detector.Detection¶
- class Detection(bbox: BoundingBox, conf: float, clss: int, mask: ndarray | None = None, mask_offsets: Tuple[int, int] | None = None)¶
Bases:
objectClass that represents single detection result in object detection model
- Parameters:
bbox (BoundingBox) – bounding box describing the detection rectangle
conf (float) – confidence of the detection
clss (int) – class of the detected object
Methods
Apply (x,y) offset to bounding box coordinates
Get center of the bounding box
Convert stored bounding box into x1y1x2y2 format
Attributes
mask of the detected object
mask_offsetsbounding box describing the detection rectangle
confidence of the detection
class of the detected object
- bbox: BoundingBox¶
bounding box describing the detection rectangle
- Type:
- clss: int¶
class of the detected object
- Type:
int
- conf: float¶
confidence of the detection
- Type:
float
- convert_to_global(offset_x: int, offset_y: int)¶
Apply (x,y) offset to bounding box coordinates
- Parameters:
offset_x (int) – _description_
offset_y (int) – _description_
- get_bbox_center() Tuple[int, int]¶
Get center of the bounding box
- Returns:
Center of the bounding box
- Return type:
Tuple[int, int]
- get_bbox_xyxy() ndarray¶
Convert stored bounding box into x1y1x2y2 format
- Returns:
Array in (x1, y1, x2, y2) format
- Return type:
np.ndarray
- mask: ndarray | None = None¶
mask of the detected object
- Type:
np.ndarray