Set dynamic to True only if imgsz is dynamic for ONNX (#17872)
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com> Co-authored-by: Ultralytics Assistant <135830346+UltralyticsAssistant@users.noreply.github.com>
This commit is contained in:
parent
5c84099a9d
commit
a672bf79dd
1 changed files with 1 additions and 1 deletions
|
|
@ -155,7 +155,7 @@ class BasePredictor:
|
||||||
same_shapes = len({x.shape for x in im}) == 1
|
same_shapes = len({x.shape for x in im}) == 1
|
||||||
letterbox = LetterBox(
|
letterbox = LetterBox(
|
||||||
self.imgsz,
|
self.imgsz,
|
||||||
auto=same_shapes and (self.model.pt or getattr(self.model, "dynamic", False)),
|
auto=same_shapes and (self.model.pt or (getattr(self.model, "dynamic", False) and not self.model.imx)),
|
||||||
stride=self.model.stride,
|
stride=self.model.stride,
|
||||||
)
|
)
|
||||||
return [letterbox(image=x) for x in im]
|
return [letterbox(image=x) for x in im]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue