Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

check if type checking is enabled

Luis Ferraz0a2f28b57f3a
diff --git a/kornia/utils/image.py b/kornia/utils/image.py
index 3382920a3..fb92077b1 100644
--- a/kornia/utils/image.py
+++ b/kornia/utils/image.py
@@ -1,8 +1,12 @@
from functools import wraps
+from typing import TYPE_CHECKING
import torch
import torch.nn as nn
+if TYPE_CHECKING:
+ import numpy as np
+
def image_to_tensor(image: "np.ndarray", keepdim: bool = True) -> torch.Tensor:
"""Convert a numpy image to a PyTorch 4d tensor image.