code: def to_segmentation(results):
      """Converts the Transformers semantic segmentation results to FiftyOne
      format.
  
      Args:
          results: Transformers semantic segmentation results
  
      Returns:
          a single or list of :class:`fiftyone.core.labels.Segmentation`
      """
      masks = [r.cpu().numpy() for r in results]
  
      if len(results) == 1:
          return _create_segmentation(masks[0])
  
      return [_create_segmentation(masks[i]) for i in range(len(masks))]
  
imports: import numpy
  from fiftyone.core.config import Config
  import fiftyone.core.labels
  from fiftyone.core.models import Model, EmbeddingsMixin
  import fiftyone.core.utils
label_desc: Use image node_id 5 for calling a global function with example usage: to_segmentation(results) and returns: unknown, _create_segmentation