diff --git a/ultralytics/engine/model.py b/ultralytics/engine/model.py index 4ff1c039ae..4defd83404 100644 --- a/ultralytics/engine/model.py +++ b/ultralytics/engine/model.py @@ -534,7 +534,7 @@ class Model(torch.nn.Module): x in ARGV for x in ("predict", "track", "mode=predict", "mode=track") ) - custom = {"conf": 0.25, "batch": 1, "save": is_cli, "mode": "predict"} # method defaults + custom = {"conf": 0.25, "batch": 1, "save": is_cli, "mode": "predict", "rect": True} # method defaults args = {**self.overrides, **custom, **kwargs} # highest priority args on the right prompts = args.pop("prompts", None) # for SAM-type models diff --git a/ultralytics/engine/predictor.py b/ultralytics/engine/predictor.py index a095825da6..efa59031a0 100644 --- a/ultralytics/engine/predictor.py +++ b/ultralytics/engine/predictor.py @@ -183,7 +183,9 @@ class BasePredictor: same_shapes = len({x.shape for x in im}) == 1 letterbox = LetterBox( self.imgsz, - auto=same_shapes and (self.model.pt or (getattr(self.model, "dynamic", False) and not self.model.imx)), + auto=same_shapes + and self.args.rect + and (self.model.pt or (getattr(self.model, "dynamic", False) and not self.model.imx)), stride=self.model.stride, ) return [letterbox(image=x) for x in im]