code: def load_data(
      self,
      files: Union[PATH_TYPE, List[PATH_TYPE]],
      mask_files: Optional[Union[PATH_TYPE, List[PATH_TYPE]]] = None,
      num_classes: Optional[int] = None,
      labels_map: Optional[Dict[int, Tuple[int, int, int]]] = None,
  ) -> List[Dict[str, Any]]:
      self.load_labels_map(num_classes, labels_map)
      if mask_files is None:
          files = filter_valid_files(
              files, valid_extensions=IMG_EXTENSIONS + NP_EXTENSIONS
          )
      else:
          files, mask_files = filter_valid_files(
              files,
              mask_files,
              valid_extensions=IMG_EXTENSIONS + NP_EXTENSIONS,
          )
      return to_samples(files, mask_files)
  
imports: import os
  from typing import Any, Dict, List, Optional, Tuple, Union
  import numpy
  from flash.core.data.io.input import DataKeys, Input
  from flash.core.data.utilities.loading import IMG_EXTENSIONS, NP_EXTENSIONS, load_image
  from flash.core.data.utilities.paths import PATH_TYPE, filter_valid_files
  from flash.core.data.utilities.samples import to_samples
  from flash.core.integrations.fiftyone.utils import FiftyOneLabelUtilities
  from flash.core.utilities.imports import _FIFTYONE_AVAILABLE, lazy_import
  from flash.image.data import ImageFilesInput, ImageNumpyInput, ImageTensorInput
  from flash.image.segmentation.output import SegmentationLabelsOutput
label_desc: Use image node_id 1 for calling the SemanticSegmentationFilesInput obj's underlying member method code with example usage: obj.load_data(files, mask_files, num_classes, labels_map) and returns: to_samples