def validate_gt_label(gt_label: np.ndarray | Sequence[int] | None) -> np.ndarray | None:
        """Validate the ground truth label batch.

        This method validates batches of ground truth labels. It handles:
            - Numpy arrays and sequences of integers
            - Type conversion to boolean
            - Shape validation

        Args:
            gt_label (``np.ndarray`` | ``Sequence[int]`` | ``None``): Input ground truth label
                batch.

        Returns:
            ``np.ndarray`` | ``None``: Validated ground truth label batch as boolean array,
                or ``None``.

        Raises:
            TypeError: If ``gt_label`` is not a numpy array or sequence of integers.
            ValueError: If ``gt_label`` shape is invalid.

        Examples:
            Validate numpy array labels::

                >>> labels = np.array([0, 1, 1, 0])
                >>> validated = NumpyImageBatchValidator.validate_gt_label(labels)
                >>> validated
                array([False,  True,  True, False])

            Validate list labels::

                >>> labels = [1, 0, 1, 1]
                >>> validated = NumpyImageBatchValidator.validate_gt_label(labels)
                >>> validated
                array([ True, False,  True,  True])
        """
        if gt_label is None:
            return None
        if isinstance(gt_label, Sequence) and not isinstance(gt_label, np.ndarray):
            gt_label = np.array(gt_label)
        if not isinstance(gt_label, np.ndarray):
            msg = f"Ground truth label batch must be a numpy.ndarray or Sequence[int], got {type(gt_label)}."
            raise TypeError(msg)
        if gt_label.ndim != 1:
            msg = f"Ground truth label batch must be 1-dimensional, got shape {gt_label.shape}."
            raise ValueError(msg)
        return gt_label.astype(bool)
Validate the ground truth label batch.

        This method validates batches of ground truth labels. It handles:
            - Numpy arrays and sequences of integers
            - Type conversion to boolean
            - Shape validation

        Args:
            gt_label (``np.ndarray`` | ``Sequence[int]`` | ``None``): Input ground truth label
                batch.

        Returns:
            ``np.ndarray`` | ``None``: Validated ground truth label batch as boolean array,
                or ``None``.

        Raises:
            TypeError: If ``gt_label`` is not a numpy array or sequence of integers.
            ValueError: If ``gt_label`` shape is invalid.

        Examples:
            Validate numpy array labels::

                >>> labels = np.array([0, 1, 1, 0])
                >>> validated = NumpyImageBatchValidator.validate_gt_label(labels)
                >>> validated
                array([False,  True,  True, False])

            Validate list labels::

                >>> labels = [1, 0, 1, 1]
                >>> validated = NumpyImageBatchValidator.validate_gt_label(labels)
                >>> validated
                array([ True, False,  True,  True])
        
src/anomalib/data/validators/numpy/image.py