code: def transform_images(
      sample_collection,
      size=None,
      min_size=None,
      max_size=None,
      interpolation=None,
      ext=None,
      force_reencode=False,
      media_field="filepath",
      output_field=None,
      output_dir=None,
      rel_dir=None,
      update_filepaths=True,
      delete_originals=False,
      num_workers=None,
      skip_failures=False,
  ):
      """Transforms the images in the sample collection according to the provided
      parameters.
  
      If no ``output_dir`` is specified and ``delete_originals`` is False, then
      if a transformation would result in overwriting an existing file with the
      same filename, the original file is renamed to ``<name>-original.<ext>``.
  
      .. note::
  
          This method will not update the ``metadata`` field of the collection
          after transforming. You can repopulate the ``metadata`` field if needed
          by calling::
  
              sample_collection.compute_metadata(overwrite=True)
  
      Args:
          sample_collection: a
              :class:`fiftyone.core.collections.SampleCollection`
          size (None): an optional ``(width, height)`` for each image. One
              dimension can be -1, in which case the aspect ratio is preserved
          min_size (None): an optional minimum ``(width, height)`` for each
              image. A dimension can be -1 if no constraint should be applied.
              The images are resized (aspect-preserving) if necessary to meet
              this constraint
          max_size (None): an optional maximum ``(width, height)`` for each
              image. A dimension can be -1 if no constraint should be applied.
              The images are resized (aspect-preserving) if necessary to meet
              this constraint
          interpolation (None): an optional ``interpolation`` argument for
              ``cv2.resize()``
          ext (None): an optional image format to re-encode the source images
              into (e.g., ".png" or ".jpg")
          force_reencode (False): whether to re-encode images whose parameters
              already match the specified values
          media_field ("filepath"): the input field containing the image paths to
              transform
          output_field (None): an optional field in which to store the paths to
              the transformed images. By default, ``media_field`` is updated
              in-place
          output_dir (None): an optional output directory in which to write the
              transformed images. If none is provided, the images are updated
              in-place
          rel_dir (None): an optional relative directory to strip from each input
              filepath to generate a unique identifier that is joined with
              ``output_dir`` to generate an output path for each image. This
              argument allows for populating nested subdirectories in
              ``output_dir`` that match the shape of the input paths
          update_filepaths (True): whether to store the output paths on the
              sample collection
          delete_originals (False): whether to delete the original images if any
              transformation was applied
          num_workers (None): a suggested number of worker processes to use
          skip_failures (False): whether to gracefully continue without raising
              an error if an image cannot be transformed
      """
      fov.validate_image_collection(sample_collection)
  
      _transform_images(
          sample_collection,
          size=size,
          min_size=min_size,
          max_size=max_size,
          interpolation=interpolation,
          ext=ext,
          force_reencode=force_reencode,
          media_field=media_field,
          output_field=output_field,
          output_dir=output_dir,
          rel_dir=rel_dir,
          update_filepaths=update_filepaths,
          delete_originals=delete_originals,
          num_workers=num_workers,
          skip_failures=skip_failures,
      )
  
imports: import logging
  import os
  import eta.core.image
  import eta.core.utils
  import fiftyone.core.storage
  import fiftyone.core.utils
  import fiftyone.core.validation
label_desc: Use image node_id 4 for calling a global function with example usage: transform_images(sample_collection, size, min_size, max_size, interpolation, ext, force_reencode, media_field, output_field, output_dir, rel_dir, update_filepaths, delete_originals, num_workers, skip_failures) without return types