Add CoreML iOS updates (#121)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Ayush Chaurasia <ayush.chaurarsia@gmail.com>
This commit is contained in:
@ -2,6 +2,7 @@ import hydra
|
||||
import torch
|
||||
|
||||
from ultralytics.yolo.utils import DEFAULT_CONFIG, ops
|
||||
from ultralytics.yolo.utils.checks import check_imgsz
|
||||
from ultralytics.yolo.utils.plotting import colors, save_one_box
|
||||
|
||||
from ..detect.predict import DetectionPredictor
|
||||
@ -96,11 +97,7 @@ class SegmentationPredictor(DetectionPredictor):
|
||||
@hydra.main(version_base=None, config_path=str(DEFAULT_CONFIG.parent), config_name=DEFAULT_CONFIG.name)
|
||||
def predict(cfg):
|
||||
cfg.model = cfg.model or "n.pt"
|
||||
sz = cfg.imgsz
|
||||
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]
|
||||
cfg.imgsz = check_imgsz(cfg.imgsz, min_dim=2) # check image size
|
||||
predictor = SegmentationPredictor(cfg)
|
||||
predictor()
|
||||
|
||||
|
Reference in New Issue
Block a user