Reference for ultralytics/models/yolo/yoloe/train_seg.py
Note
This file is available at https://github.com/ultralytics/ultralytics/blob/main/ultralytics/models/yolo/yoloe/train_seg.py. If you spot a problem please help fix it by contributing a Pull Request 🛠️. Thank you 🙏!
ultralytics.models.yolo.yoloe.train_seg.YOLOESegTrainer
YOLOESegTrainer(
cfg=DEFAULT_CFG, overrides: Optional[Dict] = None, _callbacks=None
)
Bases: YOLOETrainer
, SegmentationTrainer
Trainer class for YOLOE segmentation models.
This class combines YOLOETrainer and SegmentationTrainer to provide training functionality specifically for YOLOE segmentation models, enabling both object detection and instance segmentation capabilities.
Attributes:
Name | Type | Description |
---|---|---|
cfg |
dict
|
Configuration dictionary with training parameters. |
overrides |
dict
|
Dictionary with parameter overrides. |
_callbacks |
list
|
List of callback functions for training events. |
Source code in ultralytics/models/yolo/yoloe/train.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
|
get_model
get_model(cfg=None, weights=None, verbose=True)
Return YOLOESegModel initialized with specified config and weights.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cfg
|
dict | str
|
Model configuration dictionary or YAML file path. |
None
|
weights
|
str
|
Path to pretrained weights file. |
None
|
verbose
|
bool
|
Whether to display model information. |
True
|
Returns:
Type | Description |
---|---|
YOLOESegModel
|
Initialized YOLOE segmentation model. |
Source code in ultralytics/models/yolo/yoloe/train_seg.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
|
get_validator
get_validator()
Create and return a validator for YOLOE segmentation model evaluation.
Returns:
Type | Description |
---|---|
YOLOESegValidator
|
Validator for YOLOE segmentation models. |
Source code in ultralytics/models/yolo/yoloe/train_seg.py
51 52 53 54 55 56 57 58 59 60 61 |
|
ultralytics.models.yolo.yoloe.train_seg.YOLOEPESegTrainer
YOLOEPESegTrainer(
cfg=DEFAULT_CFG, overrides: Optional[Dict] = None, _callbacks=None
)
Bases: SegmentationTrainer
Fine-tune YOLOESeg model in linear probing way.
This trainer specializes in fine-tuning YOLOESeg models using a linear probing approach, which involves freezing most of the model and only training specific layers for efficient adaptation to new tasks.
Attributes:
Name | Type | Description |
---|---|---|
data |
dict
|
Dataset configuration containing channels, class names, and number of classes. |
Source code in ultralytics/models/yolo/segment/train.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
|
get_model
get_model(cfg=None, weights=None, verbose=True)
Return YOLOESegModel initialized with specified config and weights for linear probing.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cfg
|
dict | str
|
Model configuration dictionary or YAML file path. |
None
|
weights
|
str
|
Path to pretrained weights file. |
None
|
verbose
|
bool
|
Whether to display model information. |
True
|
Returns:
Type | Description |
---|---|
YOLOESegModel
|
Initialized YOLOE segmentation model configured for linear probing. |
Source code in ultralytics/models/yolo/yoloe/train_seg.py
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
|
ultralytics.models.yolo.yoloe.train_seg.YOLOESegTrainerFromScratch
YOLOESegTrainerFromScratch(
cfg=DEFAULT_CFG, overrides: Optional[Dict] = None, _callbacks=None
)
Bases: YOLOETrainerFromScratch
, YOLOESegTrainer
Trainer for YOLOE segmentation models trained from scratch without pretrained weights.
Source code in ultralytics/models/yolo/yoloe/train.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
|
ultralytics.models.yolo.yoloe.train_seg.YOLOESegVPTrainer
YOLOESegVPTrainer(
cfg=DEFAULT_CFG, overrides: Optional[Dict] = None, _callbacks=None
)
Bases: YOLOEVPTrainer
, YOLOESegTrainerFromScratch
Trainer for YOLOE segmentation models with Vision Prompt (VP) capabilities.
Source code in ultralytics/models/yolo/yoloe/train.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
|