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:
@ -98,7 +98,7 @@ class SegmentationPredictor(DetectionPredictor):
|
||||
def predict(cfg):
|
||||
cfg.model = cfg.model or "n.pt"
|
||||
sz = cfg.imgsz
|
||||
if type(sz) != int: # recieved listConfig
|
||||
if type(sz) != int: # received listConfig
|
||||
cfg.imgsz = [sz[0], sz[0]] if len(cfg.imgsz) == 1 else [sz[0], sz[1]] # expand
|
||||
else:
|
||||
cfg.imgsz = [sz, sz]
|
||||
|
@ -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()
|
||||
|
Reference in New Issue
Block a user