API 参考 detrium.tasks.detect.trainer detrium.tasks.detect.trainer Clean DetectionTrainer & DetectionValidator preserving all D-FINE-Turbo optimizations,
upgraded with Detrium self-contained checkpoints, CallbackManager hooks, and pluggable head transfer.
class DetectionTrainer(BaseTrainer)High-throughput DETR detection trainer (RT-DETRv2 / D-FINE / DEIM / RT-DETRv4).
名称 类型 默认值 cfgDetriumConfig—callbacksOptional[CallbackManager]NonenamesOptional[Dict[int, str]]Nonefamilystr'rtdetr'model_namestr'detrium'head_transferOptional[HeadTransferStrategy]Nonetrain_argsOptional[Dict[str, Any]]None
save_checkpoint(self, path: Path, metrics: Optional[Dict[str, Any]]=None) -> None名称 类型 默认值 pathPath—metricsOptional[Dict[str, Any]]None
load_resume_state(self, path: Union[str, Path], *, restore_distill_weight: bool=True) -> None名称 类型 默认值 pathUnion[str, Path]—restore_distill_weightboolTrue
load_tuning_state(self, path: Union[str, Path]) -> Dict[str, List[str]]名称 类型 默认值 pathUnion[str, Path]—
fit(self) -> DetMetricsclass DetectionValidator(BaseValidator)Standalone detection evaluator (works on recipes or loaded self-contained `.pt` models).
名称 类型 默认值 cfgDetriumConfig—callbacksOptional[CallbackManager]NonemodelOptional[nn.Module]NonepostprocessorOptional[nn.Module]None
val(self) -> DetMetricsclass DetectionPredictor(BasePredictor)Detection predictor (full AutoBackend + media streaming arrives in Phase 2).
predict(self, source: Any, **kwargs: Any) -> Union[List[Results], Iterator[Results]]名称 类型 默认值 sourceAny—kwargsAny—
class DetectionExporter(BaseExporter)Detection exporter (full ONNX/TRT/OpenVINO metadata exporter arrives in Phase 2).
export(self, **kwargs: Any) -> Path