ultralytics 8.0.92
updates and fixes (#2361)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Yonghye Kwon <developer.0hye@gmail.com> Co-authored-by: introvin <vinod.4166@gmail.com> Co-authored-by: marinmarcillat <58145636+marinmarcillat@users.noreply.github.com> Co-authored-by: BIGBOSS-FOX <47949596+BIGBOSS-FOX@users.noreply.github.com>
This commit is contained in:
@ -115,10 +115,8 @@ class BasePredictor:
|
||||
im (torch.Tensor | List(np.ndarray)): (N, 3, h, w) for tensor, [(h, w, 3) x N] for list.
|
||||
"""
|
||||
if not isinstance(im, torch.Tensor):
|
||||
auto = all(x.shape == im[0].shape for x in im) and self.model.pt
|
||||
if not auto:
|
||||
LOGGER.warning(
|
||||
'WARNING ⚠️ Source shapes differ. For optimal performance supply similarly-shaped sources.')
|
||||
same_shapes = all(x.shape == im[0].shape for x in im)
|
||||
auto = same_shapes and self.model.pt
|
||||
im = np.stack([LetterBox(self.imgsz, auto=auto, stride=self.model.stride)(image=x) for x in im])
|
||||
im = im[..., ::-1].transpose((0, 3, 1, 2)) # BGR to RGB, BHWC to BCHW, (n, 3, h, w)
|
||||
im = np.ascontiguousarray(im) # contiguous
|
||||
|
Reference in New Issue
Block a user