Segmentation Train Config
Bases: TrainConfig
Training configuration for instance segmentation models.
Extends :class:TrainConfig with segmentation-specific loss coefficients.
Attributes:
| Name | Type | Description |
|---|---|---|
num_select |
Optional[int]
|
Maximum number of predictions to keep per image. |
mask_point_sample_ratio |
int
|
Number of points sampled per mask for point-based mask loss computation. |
mask_ce_loss_coef |
float
|
Cross-entropy loss weight for mask prediction. |
mask_dice_loss_coef |
float
|
Dice loss weight for mask prediction. |
cls_loss_coef |
float
|
Classification loss weight. Defaults to |
segmentation_head |
bool
|
Whether to attach the segmentation head. |
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_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).