def validate_image(image: np.ndarray) -> np.ndarray:
        """Validate the video batch array.

        Args:
            image (``np.ndarray``): Input video batch array to validate.

        Returns:
            ``np.ndarray``: Validated video batch array as float32.

        Raises:
            TypeError: If the input is not a numpy array.
            ValueError: If the array dimensions or channel count are invalid.

        Example:
            >>> import numpy as np
            >>> validator = NumpyVideoBatchValidator()
            >>> video_batch = np.random.rand(2, 10, 224, 224, 3)  # [N, T, H, W, C]
            >>> validated_batch = validator.validate_image(video_batch)
            >>> print(validated_batch.shape, validated_batch.dtype)
            (2, 10, 224, 224, 3) float32
        """
        if not isinstance(image, np.ndarray):
            msg = f"Video batch must be a numpy.ndarray, got {type(image)}."
            raise TypeError(msg)
        if image.ndim not in {4, 5}:
            msg = f"Video batch must have 4 or 5 dimensions, got shape {image.shape}."
            raise ValueError(msg)
        if image.ndim == 4:
            if image.shape[3] not in {1, 3}:
                msg = f"Video batch must have 1 or 3 channels for single frame, got {image.shape[3]}."
                raise ValueError(msg)
        elif image.ndim == 5 and image.shape[4] not in {1, 3}:
            msg = f"Video batch must have 1 or 3 channels, got {image.shape[4]}."
            raise ValueError(msg)
        return image.astype(np.float32)
Validate the video batch array.

        Args:
            image (``np.ndarray``): Input video batch array to validate.

        Returns:
            ``np.ndarray``: Validated video batch array as float32.

        Raises:
            TypeError: If the input is not a numpy array.
            ValueError: If the array dimensions or channel count are invalid.

        Example:
            >>> import numpy as np
            >>> validator = NumpyVideoBatchValidator()
            >>> video_batch = np.random.rand(2, 10, 224, 224, 3)  # [N, T, H, W, C]
            >>> validated_batch = validator.validate_image(video_batch)
            >>> print(validated_batch.shape, validated_batch.dtype)
            (2, 10, 224, 224, 3) float32
        
src/anomalib/data/validators/numpy/video.py