code: def _get_mask_values(samples, pred_field, gt_field):
      _samples = samples.select_fields([gt_field, pred_field])
      pred_field, processing_frames = samples._handle_frame_field(
          pred_field
      )
      gt_field, _ = samples._handle_frame_field(gt_field)
  
      values = set()
      is_rgb = False
  
      for sample in _samples.iter_samples(progress=True):
          if processing_frames:
              images = sample.frames.values()
          else:
              images = [sample]
  
          for image in images:
              for field in (pred_field, gt_field):
                  seg = image[field]
                  if seg is not None and seg.has_mask:
                      mask = seg.get_mask()
                      if mask.ndim == 3:
                          is_rgb = True
                          mask = _rgb_array_to_int(mask)
  
                      values.update(mask.ravel())
  
      values = sorted(values)
  
      if is_rgb:
          classes = [_int_to_hex(v) for v in values]
      else:
          classes = [str(v) for v in values]
  
      return values, classes
  
imports: from copy import deepcopy
  import logging
  import inspect
  import warnings
  import numpy
  import sklearn.metrics
  import eta.core.image
  import eta.core.utils
  import fiftyone
  import fiftyone.core.evaluation
  import fiftyone.core.fields
  import fiftyone.core.labels
  import fiftyone.core.utils
  import fiftyone.core.validation
  from .base import BaseEvaluationResults
label_desc: Use image node_id 7 for calling a global function with example usage: _get_mask_values(samples, pred_field, gt_field) and returns: values,  classes