|
|
@@ -330,7 +330,7 @@ class Predict:
|
|
|
im = img_tensor.permute(1, 2, 0) # [H, W, 3]
|
|
|
# im_resized = skimage.transform.resize(im.cpu().numpy().astype(np.float32), (512, 512)) # (512, 512, 3)
|
|
|
if im.shape != (512, 512, 3):
|
|
|
- im_resized = cv2.resize(im.cpu().numpy().astype(np.float32), (512, 512), interpolation=cv2.INTER_LINEAR)
|
|
|
+ im = cv2.resize(im.cpu().numpy().astype(np.float32), (512, 512), interpolation=cv2.INTER_LINEAR)
|
|
|
img_ = torch.tensor(im).permute(2, 0, 1) # [3, 512, 512]
|
|
|
t_end = time.time()
|
|
|
print(f"Image preprocessing used: {t_end - t_start:.4f} seconds")
|
|
|
@@ -424,7 +424,7 @@ class Predict1:
|
|
|
im = img_tensor.permute(1, 2, 0) # [H, W, 3]
|
|
|
# im_resized = skimage.transform.resize(im.cpu().numpy().astype(np.float32), (512, 512)) # (512, 512, 3)
|
|
|
if im.shape != (512, 512, 3):
|
|
|
- im_resized = cv2.resize(im.cpu().numpy().astype(np.float32), (512, 512), interpolation=cv2.INTER_LINEAR)
|
|
|
+ im = cv2.resize(im.cpu().numpy().astype(np.float32), (512, 512), interpolation=cv2.INTER_LINEAR)
|
|
|
img_ = torch.tensor(im).permute(2, 0, 1) # [3, 512, 512]
|
|
|
t_end = time.time()
|
|
|
print(f"Image preprocessing used: {t_end - t_start:.4f} seconds")
|