code: def compute_segment_ious(preds, gts):
      """Computes the pairwise IoUs between the predicted and ground truth
      temporal detections.
  
      Args:
          preds: a list of predicted
              :class:`fiftyone.core.labels.TemporalDetection` instances
          gts: a list of ground truth
              :class:`fiftyone.core.labels.TemporalDetection` instances
  
      Returns:
          a ``num_preds x num_gts`` array of segment IoUs
      """
      if not preds or not gts:
          return np.zeros((len(preds), len(gts)))
  
      return _compute_segment_ious(preds, gts)
  
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 2 for calling a global function with example usage: compute_segment_ious(preds, gts) and returns: _compute_segment_ious, np