Faster batch `same_shapes` (#8851)

pull/8866/head
Glenn Jocher 9 months ago committed by GitHub
parent 2ea6b2b889
commit 617ab21523
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      ultralytics/engine/predictor.py

@ -151,7 +151,7 @@ class BasePredictor:
Returns:
(list): A list of transformed images.
"""
same_shapes = all(x.shape == im[0].shape for x in im)
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)
return [letterbox(image=x) for x in im]

Loading…
Cancel
Save