detrium.core.results

Unified Results object and task-specific prediction containers for all 6 Detrium tasks. Tasks supported by contract: - detect -> Results.boxes (Boxes) - segment -> Results.boxes (Boxes) + Results.masks (Masks) - semseg -> Results.semseg (SemSeg) - pose -> Results.boxes (Boxes) + Results.keypoints (Keypoints) - classify -> Results.probs (Probs) - obb -> Results.obb (OBB)

class Boxes(_BaseDataContainer)

Axis-aligned 2D bounding boxes container. Internal `data` layout: shape `(N, 6)` with columns `[x1, y1, x2, y2, conf, cls]`.

名称类型默认值
dataTensorOrArray—
orig_shapeTuple[int, int]—
from_xyxy_conf_cls(cls, boxes_xyxy: TensorOrArray, scores: TensorOrArray, labels: TensorOrArray, orig_shape: Tuple[int, int]) -> 'Boxes'
名称类型默认值
boxes_xyxyTensorOrArray—
scoresTensorOrArray—
labelsTensorOrArray—
orig_shapeTuple[int, int]—
class Masks(_BaseDataContainer)

Instance segmentation binary/soft masks container (`segment` task). Internal `data` layout: shape `(N, H, W)`.

名称类型默认值
dataTensorOrArray—
orig_shapeTuple[int, int]—
class SemSeg(_BaseDataContainer)

Semantic segmentation dense pixel map container (`semseg` task). Internal `data` layout: integer class map `(H, W)` (optional logits/probs `(C, H, W)`).

名称类型默认值
class_mapTensorOrArray—
orig_shapeTuple[int, int]—
probsOptional[TensorOrArray]None
class OBB(_BaseDataContainer)

Oriented bounding boxes container (`obb` task). Internal `data` layout: shape `(N, 7)` with columns `[cx, cy, w, h, angle_rad, conf, cls]`.

名称类型默认值
dataTensorOrArray—
orig_shapeTuple[int, int]—
class Results

Unified per-image inference result across all 6 Detrium vision tasks.

字段

名称类型默认值
orig_imgOptional[np.ndarray]—
orig_shapeTuple[int, int]—
namesDict[int, str]—
taskstr'detect'
pathOptional[str]None
speedDict[str, float]field(default_factory=lambda : {'preprocess': 0.0, 'inference': 0.0, 'postprocess': 0.0})
boxesOptional[Boxes]None
masksOptional[Masks]None
semsegOptional[SemSeg]None
keypointsOptional[Keypoints]None
probsOptional[Probs]None
obbOptional[OBB]None
plot(self, *, conf: bool=True, labels: bool=True, line_width: Optional[int]=None) -> np.ndarray

Render predictions onto `orig_img` and return an RGB uint8 numpy array.

名称类型默认值
confboolTrue
labelsboolTrue
line_widthOptional[int]None
save(self, filename: Union[str, Path], **plot_kwargs: Any) -> Path

Save the annotated image to `filename`.

名称类型默认值
filenameUnion[str, Path]—
plot_kwargsAny—