def validate_image(image: torch.Tensor) -> Image:
        """Validate the image tensor.

        This method validates and normalizes input image tensors. It handles:
            - RGB images only
            - Channel-first format [C, H, W]
            - Type conversion to float32
            - Value range normalization

        Args:
            image (``torch.Tensor``): Input image tensor to validate.

        Returns:
            ``Image``: Validated image as a torchvision Image object.

        Raises:
            TypeError: If ``image`` is not a torch.Tensor.
            ValueError: If ``image`` dimensions or channels are invalid.

        Example:
            Validate RGB image::

                >>> import torch
                >>> from anomalib.data.validators import DepthValidator
                >>> image = torch.rand(3, 256, 256)  # [C, H, W]
                >>> validated = DepthValidator.validate_image(image)
                >>> validated.shape
                torch.Size([3, 256, 256])
        """
        if not isinstance(image, torch.Tensor):
            msg = f"Image must be a torch.Tensor, got {type(image)}."
            raise TypeError(msg)
        if image.ndim != 3:
            msg = f"Image must have shape [C, H, W], got shape {image.shape}."
            raise ValueError(msg)
        if image.shape[0] != 3:
            msg = f"Image must have 3 channels, got {image.shape[0]}."
            raise ValueError(msg)
        return Image(to_dtype_image(image, torch.float32, scale=True))
Validate the image tensor.

        This method validates and normalizes input image tensors. It handles:
            - RGB images only
            - Channel-first format [C, H, W]
            - Type conversion to float32
            - Value range normalization

        Args:
            image (``torch.Tensor``): Input image tensor to validate.

        Returns:
            ``Image``: Validated image as a torchvision Image object.

        Raises:
            TypeError: If ``image`` is not a torch.Tensor.
            ValueError: If ``image`` dimensions or channels are invalid.

        Example:
            Validate RGB image::

                >>> import torch
                >>> from anomalib.data.validators import DepthValidator
                >>> image = torch.rand(3, 256, 256)  # [C, H, W]
                >>> validated = DepthValidator.validate_image(image)
                >>> validated.shape
                torch.Size([3, 256, 256])
        
src/anomalib/data/validators/torch/depth.py