π Geometric Computer Vision Library for Spatial AI
Python artificial-intelligencecomputer-visiondeep-learninghacktoberfestimage-processingmachine-learningneural-networkpythonpytorchroboticsspatial-ai
check if type checking is enabled
Luis Ferraz0a2f28b57f3a
diff --git a/kornia/utils/image.py b/kornia/utils/image.pyindex 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_CHECKINGimport torchimport 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.