Start export implementation (#110)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
c1b38428bc
commit
92dad1c1b5
32 changed files with 827 additions and 222 deletions
|
|
@ -12,11 +12,9 @@ from ultralytics.yolo.utils.plotting import plot_images, plot_results
|
|||
from ultralytics.yolo.utils.tal import TaskAlignedAssigner, dist2bbox, make_anchors
|
||||
from ultralytics.yolo.utils.torch_utils import de_parallel
|
||||
|
||||
from ..detect import DetectionTrainer
|
||||
|
||||
|
||||
# BaseTrainer python usage
|
||||
class SegmentationTrainer(DetectionTrainer):
|
||||
class SegmentationTrainer(v8.detect.DetectionTrainer):
|
||||
|
||||
def load_model(self, model_cfg=None, weights=None, verbose=True):
|
||||
model = SegmentationModel(model_cfg or weights["model"].yaml, ch=3, nc=self.data["nc"], verbose=verbose)
|
||||
|
|
@ -174,7 +172,7 @@ class SegLoss:
|
|||
|
||||
@hydra.main(version_base=None, config_path=str(DEFAULT_CONFIG.parent), config_name=DEFAULT_CONFIG.name)
|
||||
def train(cfg):
|
||||
cfg.model = cfg.model or "models/yolov8n-seg.yaml"
|
||||
cfg.model = cfg.model or "yolov8n-seg.yaml"
|
||||
cfg.data = cfg.data or "coco128-seg.yaml" # or yolo.ClassificationDataset("mnist")
|
||||
trainer = SegmentationTrainer(cfg)
|
||||
trainer.train()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue