class ModelFamilyAdapter(ABC)Contract implemented by each DETR model family (e.g. rtdetr_family).
字段
| 名称 | 类型 | 默认值 |
|---|---|---|
family_name | str | '' |
supported_tasks | Tuple[str, ...] | ('detect',) |
license_name | str | 'Apache-2.0' |
matches(self, name_or_cfg: Union[str, Mapping[str, Any]]) -> boolReturn True if this adapter owns the given model alias, recipe, or config dict.
| 名称 | 类型 | 默认值 |
|---|---|---|
name_or_cfg | Union[str, Mapping[str, Any]] | — |
build_model_and_postprocessor(self, cfg: Any) -> Tuple[nn.Module, Optional[nn.Module]]Instantiate `(model, postprocessor)` from a DetriumConfig.
| 名称 | 类型 | 默认值 |
|---|---|---|
cfg | Any | — |
build_deploy_module(self, model: nn.Module, postprocessor: Optional[nn.Module]) -> nn.ModuleWrap model + postprocessor into a deploy-ready inference/export nn.Module.
| 名称 | 类型 | 默认值 |
|---|---|---|
model | nn.Module | — |
postprocessor | Optional[nn.Module] | — |
export_context(self) -> ContextManager[Any]Optional context manager active during ONNX/TRT tracing (e.g. disable custom CUDA ops).