class_docstr: Stardard pixelwise segmentation evaluation.
  
  This class can optionally be configured to evaluate along only the
  boundaries of the ground truth segmentation masks.
  
  Args:
      config: a :class:`SimpleEvaluationConfig`
class_docstr_tok: ["Stardard","pixelwise","segmentation","evaluation",".","This","class","can","optionally","be","configured","to","evaluate","along","only","the","boundaries","of","the","ground","truth","segmentation","masks",".","Args",":","config",":","a",":","class",":","`","SimpleEvaluationConfig","`"]
code: def evaluate_samples(self, samples, eval_key=None, mask_targets=None):
      pred_field = self.config.pred_field
      gt_field = self.config.gt_field
  
      if mask_targets is not None:
          if fof.is_rgb_mask_targets(mask_targets):
              mask_targets = {
                  _hex_to_int(k): v for k, v in mask_targets.items()
              }
  
          values, classes = zip(*sorted(mask_targets.items()))
      else:
          logger.info("Computing possible mask values...")
          values, classes = _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)
  
      nc = len(values)
      confusion_matrix = np.zeros((nc, nc), dtype=int)
  
      bandwidth = self.config.bandwidth
      average = self.config.average
      compute_dice = self.config.compute_dice
  
      if eval_key is not None:
          acc_field = "%s_accuracy" % eval_key
          pre_field = "%s_precision" % eval_key
          rec_field = "%s_recall" % eval_key
          if compute_dice:
              dice_field = "%s_dice" % eval_key
  
      logger.info("Evaluating segmentations...")
      for sample in _samples.iter_samples(progress=True):
          if processing_frames:
              images = sample.frames.values()
          else:
              images = [sample]
  
          sample_conf_mat = np.zeros((nc, nc), dtype=int)
          for image in images:
              gt_seg = image[gt_field]
              if gt_seg is None or not gt_seg.has_mask:
                  msg = "Skipping sample with missing ground truth mask"
                  warnings.warn(msg)
                  continue
  
              pred_seg = image[pred_field]
              if pred_seg is None or not pred_seg.has_mask:
                  msg = "Skipping sample with missing prediction mask"
                  warnings.warn(msg)
                  continue
  
              image_conf_mat = _compute_pixel_confusion_matrix(
                  pred_seg.get_mask(),
                  gt_seg.get_mask(),
                  values,
                  bandwidth=bandwidth,
              )
              sample_conf_mat += image_conf_mat
  
              # Record frame stats, if requested
              if processing_frames and eval_key is not None:
                  facc, fpre, frec = _compute_accuracy_precision_recall(
                      image_conf_mat, values, average
                  )
                  image[acc_field] = facc
                  image[pre_field] = fpre
                  image[rec_field] = frec
                  if compute_dice:
                      image[dice_field] = _compute_dice_score(
                          image_conf_mat
                      )
  
          confusion_matrix += sample_conf_mat
  
          # Record sample stats, if requested
          if eval_key is not None:
              sacc, spre, srec = _compute_accuracy_precision_recall(
                  sample_conf_mat, values, average
              )
              sample[acc_field] = sacc
              sample[pre_field] = spre
              sample[rec_field] = srec
              if compute_dice:
                  sample[dice_field] = _compute_dice_score(
                      confusion_matrix
                  )
  
              sample.save()
  
      if nc > 0:
          missing = classes[0] if values[0] in (0, "#000000") else None
      else:
          missing = None
  
      return SegmentationResults(
          samples,
          self.config,
          eval_key,
          confusion_matrix,
          classes,
          missing=missing,
          backend=self,
      )
  
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 1 for calling the SimpleEvaluation obj's underlying member method code with example usage: obj.evaluate_samples(samples, eval_key, mask_targets) and returns: SegmentationResults