def validate_original_image(original_image: torch.Tensor | Video | None) -> torch.Tensor | Video | None:
        """Validate the original videos for a batch.

        Validates that the input videos have the correct dimensions and channel count.
        Adds temporal dimension to single frame inputs.

        Args:
            original_image (torch.Tensor | Video | None): Input original videos. Should be
                either:
                - Shape ``(B,C,H,W)`` for single frame images
                - Shape ``(B,T,C,H,W)`` for multi-frame videos
                Where:
                    - ``B`` is batch size
                    - ``T`` is number of frames
                    - ``C`` is number of channels (must be 3)
                    - ``H`` is height
                    - ``W`` is width

        Returns:
            torch.Tensor | Video | None: Validated original videos.

        Raises:
            TypeError: If input is not a ``torch.Tensor`` or ``torchvision.Video``.
            ValueError: If video has invalid shape or channel count.

        Examples:
            >>> import torch
            >>> from torchvision.tv_tensors import Video
            >>> from anomalib.data.validators import VideoBatchValidator
            >>> # Create 2 videos with 10 frames each
            >>> original_videos = Video(torch.rand(2, 10, 3, 224, 224))
            >>> validated_videos = VideoBatchValidator.validate_original_image(
            ...     original_videos
            ... )
            >>> print(validated_videos.shape)
            torch.Size([2, 10, 3, 224, 224])
        """
        if original_image is None:
            return None

        if not isinstance(original_image, torch.Tensor | Video):
            msg = f"Original image must be a torch.Tensor or torchvision Video object, got {type(original_image)}."
            raise TypeError(msg)

        if original_image.ndim not in {4, 5}:  # (B, C, H, W) or (B, T, C, H, W)
            msg = (
                "Original image/video must have shape [B, C, H, W] for single frame or "
                f"[B, T, C, H, W] for multi-frame, got shape {original_image.shape}."
            )
            raise ValueError(msg)

        if original_image.ndim == 4:
            # Add a temporal dimension for single frame videos
            original_image = original_image.unsqueeze(1)
        if original_image.shape[2] != 3:
            msg = f"Original video must have 3 channels, got {original_image.shape[2]}."
            raise ValueError(msg)

        return original_image
Validate the original videos for a batch.

        Validates that the input videos have the correct dimensions and channel count.
        Adds temporal dimension to single frame inputs.

        Args:
            original_image (torch.Tensor | Video | None): Input original videos. Should be
                either:
                - Shape ``(B,C,H,W)`` for single frame images
                - Shape ``(B,T,C,H,W)`` for multi-frame videos
                Where:
                    - ``B`` is batch size
                    - ``T`` is number of frames
                    - ``C`` is number of channels (must be 3)
                    - ``H`` is height
                    - ``W`` is width

        Returns:
            torch.Tensor | Video | None: Validated original videos.

        Raises:
            TypeError: If input is not a ``torch.Tensor`` or ``torchvision.Video``.
            ValueError: If video has invalid shape or channel count.

        Examples:
            >>> import torch
            >>> from torchvision.tv_tensors import Video
            >>> from anomalib.data.validators import VideoBatchValidator
            >>> # Create 2 videos with 10 frames each
            >>> original_videos = Video(torch.rand(2, 10, 3, 224, 224))
            >>> validated_videos = VideoBatchValidator.validate_original_image(
            ...     original_videos
            ... )
            >>> print(validated_videos.shape)
            torch.Size([2, 10, 3, 224, 224])
        
src/anomalib/data/validators/torch/video.py