|
|
@ -122,7 +122,8 @@ class BasePredictor:
|
|
|
|
not_tensor = not isinstance(im, torch.Tensor)
|
|
|
|
not_tensor = not isinstance(im, torch.Tensor)
|
|
|
|
if not_tensor:
|
|
|
|
if not_tensor:
|
|
|
|
im = np.stack(self.pre_transform(im))
|
|
|
|
im = np.stack(self.pre_transform(im))
|
|
|
|
im = im[..., ::-1].transpose((0, 3, 1, 2)) # BGR to RGB, BHWC to BCHW, (n, 3, h, w)
|
|
|
|
im = np.expand_dims(im, -1)
|
|
|
|
|
|
|
|
im = im[..., ::].transpose((0, 3, 1, 2)) # BGR to RGB, BHWC to BCHW, (n, 3, h, w)
|
|
|
|
im = np.ascontiguousarray(im) # contiguous
|
|
|
|
im = np.ascontiguousarray(im) # contiguous
|
|
|
|
im = torch.from_numpy(im)
|
|
|
|
im = torch.from_numpy(im)
|
|
|
|
|
|
|
|
|
|
|
|