SegmentationTrainConfig extends TrainConfig with additional parameters that control mask prediction losses. It is used automatically when you call model.train() on any segmentation variant (RFDETRSegNano, RFDETRSegSmall, RFDETRSegMedium, RFDETRSegLarge, RFDETRSegXLarge, RFDETRSeg2XLarge).
You do not need to instantiate this class directly — pass parameters as keyword arguments to model.train():
SegmentationTrainConfig inherits all fields from TrainConfig. See TrainConfig for the complete list of inherited parameters (learning rate, batch size, logging, multi-GPU, etc.). Only the additional and overridden fields are documented on this page.
Segmentation-specific fields
Number of points sampled per mask for the point-based cross-entropy loss. A higher value increases loss quality at the cost of more memory. Corresponds to the
num_points in the PointRend-style mask loss.Weight applied to the binary cross-entropy component of the mask loss.
Weight applied to the Dice loss component of the mask loss.
Overridden defaults
The followingTrainConfig fields have different defaults in SegmentationTrainConfig:
Weight applied to the classification loss. Overrides the
TrainConfig default of 1.0 to match the higher mask loss coefficients.Always
True for segmentation models. This field is fixed and cannot be overridden.Full usage example
Related
TrainConfig
Complete reference for all inherited training parameters.
Model variants
All available segmentation model classes and their default configs.
Run segmentation
Guide to running inference with segmentation models.
Training overview
End-to-end training guide for custom datasets.