code: def _rand_labels(size: Tuple[int, int], num_classes: int):
      data: np.ndarray = np.random.randint(0, num_classes, (*size, 1))
      data = data.repeat(3, axis=-1)
      return Image.fromarray(data.astype(np.uint8))
  
imports: import os
  from pathlib import Path
  from typing import Callable, Dict, List, Tuple
  import numpy
  import pytest
  import torch
  from flash import Trainer
  from flash.core.data.io.input import DataKeys
  from flash.core.data.io.input_transform import InputTransform
  from flash.core.data.transforms import ApplyToKeys
  from flash.core.utilities.imports import _FIFTYONE_AVAILABLE, _MATPLOTLIB_AVAILABLE, _PIL_AVAILABLE, _SEGMENTATION_MODELS_AVAILABLE, _TOPIC_IMAGE_AVAILABLE
  from flash.image import SemanticSegmentation, SemanticSegmentationData
label_desc: Use image node_id 3 for calling a global function with example usage: _rand_labels(size, num_classes) and returns: Image