ultralytics 8.3.35 enable auto letterbox if model is dynamic (#17687)
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
b48cec2e54
commit
b7e9e91d46
2 changed files with 6 additions and 2 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue