detrium.utils.plotting

Visualization utilities and Annotator for all 6 Detrium vision tasks.

class Annotator

Clean image annotator supporting RGB numpy arrays (uses OpenCV when available, PIL fallback).

名称类型默认值
image_rgbnp.ndarray—
line_widthOptional[int]None
box_label(self, box: Sequence[float], label: str='', color: Tuple[int, int, int]=(255, 56, 56), txt_color: Tuple[int, int, int]=(255, 255, 255)) -> None
名称类型默认值
boxSequence[float]—
labelstr''
colorTuple[int, int, int](255, 56, 56)
txt_colorTuple[int, int, int](255, 255, 255)
mask_overlay(self, mask: np.ndarray, color: Tuple[int, int, int], alpha: float=0.45) -> None
名称类型默认值
masknp.ndarray—
colorTuple[int, int, int]—
alphafloat0.45
keypoints(self, kpts_xy: np.ndarray, kpts_conf: Optional[np.ndarray]=None, conf_thr: float=0.25) -> None
名称类型默认值
kpts_xynp.ndarray—
kpts_confOptional[np.ndarray]None
conf_thrfloat0.25
obb_label(self, corners: np.ndarray, label: str='', color: Tuple[int, int, int]=(255, 56, 56)) -> None
名称类型默认值
cornersnp.ndarray—
labelstr''
colorTuple[int, int, int](255, 56, 56)
plot_training_curves(csv_path: Path, out_path: Optional[Path]=None) -> Optional[Path]

Generate a summary `results.png` chart from `results.csv` if matplotlib is installed.

名称类型默认值
csv_pathPath—
out_pathOptional[Path]None