`ultralytics 8.3.35` enable `auto` letterbox if model is `dynamic` (#17687)

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
pull/17702/head v8.3.35
Laughing 1 week ago committed by GitHub
parent b48cec2e54
commit b7e9e91d46
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      ultralytics/__init__.py
  2. 6
      ultralytics/engine/predictor.py

@ -1,6 +1,6 @@
# Ultralytics YOLO 🚀, AGPL-3.0 license # Ultralytics YOLO 🚀, AGPL-3.0 license
__version__ = "8.3.34" __version__ = "8.3.35"
import os import os

@ -153,7 +153,11 @@ class BasePredictor:
(list): A list of transformed images. (list): A list of transformed images.
""" """
same_shapes = len({x.shape for x in im}) == 1 same_shapes = len({x.shape for x in im}) == 1
letterbox = LetterBox(self.imgsz, auto=same_shapes and self.model.pt, stride=self.model.stride) letterbox = LetterBox(
self.imgsz,
auto=same_shapes and (self.model.pt or getattr(self.model, "dynamic", False)),
stride=self.model.stride,
)
return [letterbox(image=x) for x in im] return [letterbox(image=x) for x in im]
def postprocess(self, preds, img, orig_imgs): def postprocess(self, preds, img, orig_imgs):

Loading…
Cancel
Save