code: def _compute_mask_ious(
      preds, gts, tolerance, error_level, iscrowd=None, classwise=False
  ):
      is_symmetric = preds is gts
  
      with contextlib.ExitStack() as context:
          # We're ignoring errors, so suppress shapely logging that occurs when
          # invalid geometries are encountered
          if error_level > 1:
              # pylint: disable=no-member
              context.enter_context(
                  fou.LoggingLevel(logging.CRITICAL, logger="shapely")
              )
  
          pred_polys = _masks_to_polylines(
              preds, tolerance, error_level
          )
  
          if is_symmetric:
              gt_polys = pred_polys
          else:
              gt_polys = _masks_to_polylines(
                  gts, tolerance, error_level
              )
  
      if iscrowd is not None:
          gt_crowds = [iscrowd(gt) for gt in gts]
      else:
          gt_crowds = [False] * len(gts)
  
      return _compute_polygon_ious(
          pred_polys,
          gt_polys,
          error_level,
          classwise=classwise,
          gt_crowds=gt_crowds,
      )
  
imports: import contextlib
  import itertools
  import logging
  import numpy
  import scipy.spatial
  import eta.core.numutils
  import eta.core.utils
  import fiftyone.core.labels
  import fiftyone.core.utils
  import fiftyone.core.validation
  from .utils3d import compute_cuboid_iou
label_desc: Use image node_id 16 for calling a global function with example usage: _compute_mask_ious(preds, gts, tolerance, error_level, iscrowd, classwise) and returns: _compute_polygon_ious