code: def import_segmentations(
      sample_collection, in_field, update=True, delete_images=False
  ):
      """Imports the segmentations (or heatmaps) stored on disk in the specified
      field to in-database arrays.
  
      Any labels without images on disk are skipped.
  
      Args:
          sample_collection: a
              :class:`fiftyone.core.collections.SampleCollection`
          in_field: the name of the
              :class:`fiftyone.core.labels.Segmentation` or
              :class:`fiftyone.core.labels.Heatmap` field
          update (True): whether to delete the image paths from the labels
          delete_images (False): whether to delete any imported images from disk
      """
      fov.validate_collection_label_fields(
          sample_collection, in_field, (fol.Segmentation, fol.Heatmap)
      )
  
      samples = sample_collection.select_fields(in_field)
      in_field, processing_frames = samples._handle_frame_field(
          in_field
      )
  
      for sample in samples.iter_samples(autosave=True, progress=True):
          if processing_frames:
              images = sample.frames.values()
          else:
              images = [sample]
  
          for image in images:
              label = image[in_field]
              if label is None:
                  continue
  
              if isinstance(label, fol.Heatmap):
                  if label.map_path is not None:
                      del_path = (
                          label.map_path if delete_images else None
                      )
                      label.import_map(update=update)
                      if del_path:
                          etau.delete_file(del_path)
              else:
                  if label.mask_path is not None:
                      del_path = (
                          label.mask_path if delete_images else None
                      )
                      label.import_mask(update=update)
                      if del_path:
                          etau.delete_file(del_path)
  
file_path: fiftyone/fiftyone/utils/labels.py
imports: import eta.core.utils
  import fiftyone.core.labels
  import fiftyone.core.utils
  import fiftyone.core.validation
label_desc: Use image node_id 3 for calling a global function with example usage: import_segmentations(sample_collection, in_field, update, delete_images) without return types