ultralytics 8.0.172 faster LetterBox() and Classify Tune fix (#4766)

Co-authored-by: BardJun <70683507+jy1002@users.noreply.github.com>
This commit is contained in:
Glenn Jocher 2023-09-06 22:00:04 +02:00 committed by GitHub
parent 577d066fb2
commit 8fd9a1a048
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 68 additions and 26 deletions

View file

@ -143,8 +143,8 @@ class BasePredictor:
(list): A list of transformed images.
"""
same_shapes = all(x.shape == im[0].shape for x in im)
auto = same_shapes and self.model.pt
return [LetterBox(self.imgsz, auto=auto, stride=self.model.stride)(image=x) for x in im]
letterbox = LetterBox(self.imgsz, auto=same_shapes and self.model.pt, stride=self.model.stride)
return [letterbox(image=x) for x in im]
def write_results(self, idx, results, batch):
"""Write inference results to a file or directory."""