Keypoint Train Config
Bases: TrainConfig
Training configuration for keypoint detection models.
Extends :class:TrainConfig with keypoint-specific loss coefficients and
metric-smoothing defaults tuned for the NLL-Cholesky keypoint head, which
produces noisy per-epoch OKS metrics during early fine-tuning.
Attributes:
| Name | Type | Description |
|---|---|---|
cls_loss_coef |
float
|
Classification loss weight. |
keypoint_l1_loss_coef |
float
|
L1 regression loss weight for keypoint coordinates. |
keypoint_findable_loss_coef |
float
|
Loss weight for the keypoint visibility head. |
keypoint_visible_loss_coef |
float
|
Loss weight for the keypoint visibility score. |
keypoint_nll_loss_coef |
float
|
NLL-Cholesky loss weight. Restored to |
smooth_alpha |
float
|
EMA smoothing factor for :class: |
skip_best_epochs |
int
|
Number of epochs to skip before checkpoint selection begins.
Overrides the :class: |
Source code in src/rfdetr/config.py
Functions¶
expand_paths(v)
classmethod
¶
Expand and normalize dataset/output directory paths via os.fspath → expanduser → realpath.
Source code in src/rfdetr/config.py
validate_batch_size(v)
classmethod
¶
Validate batch_size is a positive integer or the literal 'auto'.
Source code in src/rfdetr/config.py
validate_ema_headroom(v)
classmethod
¶
Validate auto_batch_ema_headroom is in (0, 1].
Source code in src/rfdetr/config.py
validate_eval_ema_only()
¶
eval_ema_only has no EMA model to evaluate without use_ema=True.
Source code in src/rfdetr/config.py
validate_lr_scheduler_kwargs()
¶
Reject unknown lr_scheduler_kwargs keys for the managed "step" / "cosine" presets.
Managed presets consume only min_factor and lr_drop; any other key would be silently ignored, so surface
it as an error (mirroring validate_optimizer_kwargs). Explicit schedulers forward their kwargs verbatim to
the constructor and are left unchecked here.
Source code in src/rfdetr/config.py
validate_lr_scheduler_name(v)
classmethod
¶
Validate a string lr_scheduler: a bare name must be a managed preset, else use a dotted path.
Source code in src/rfdetr/config.py
validate_optimizer_kwargs()
¶
Reserved optimizer kwargs are only rejected for managed (short-name) optimizers.
Source code in src/rfdetr/config.py
validate_optimizer_name(v)
classmethod
¶
Validate a string optimizer: a bare name must be a native torch.optim optimizer.
Source code in src/rfdetr/config.py
validate_positive_intervals(v)
classmethod
¶
Validate interval fields are >= 1.
Source code in src/rfdetr/config.py
validate_positive_train_steps(v)
classmethod
¶
Validate accumulation, target-effective batch, and max targets are >= 1.
Source code in src/rfdetr/config.py
validate_prefetch_factor(v)
classmethod
¶
Validate prefetch_factor is None or >= 1.
Source code in src/rfdetr/config.py
validate_smooth_alpha(v)
classmethod
¶
Validate smooth_alpha is in [0.0, 1.0).