code: def preprocess_example(example, dtype=tf.float32):
      """Preprocesses the given image.
  
      Args:
        example: dict; Example coming from TFDS.
        dtype: Tensorflow data type; Data type of the image.
  
      Returns:
        An example dict as required by the model.
      """
      example_out = {}
      # For simplicity, just resize all images to the same shape:
      example_out["inputs"] = tf.image.resize(
          dataset_utils.normalize(example["image"], dtype),
          IMAGE_SIZE,
          "bilinear",
      )
      example_out["inputs"] = tf.cast(example_out["inputs"], dtype)
  
      example_out["label"] = tf.image.resize(
          example["segmentation_mask"], IMAGE_SIZE, "nearest"
      )
      example_out["label"] = tf.squeeze(example_out["label"], axis=2)
      example_out["label"] = tf.cast(example_out["label"], dtype)
  
      # The dataset has three classes: object/pet (label 1), background (label 2)
      # and object outline (label 3). Convert to zero-indexed labels:
      example_out["label"] -= 1
  
      return example_out
  
file_path: scenic/scenic/dataset_lib/oxford_pets_dataset.py
imports: import functools
  from typing import Optional
  from absl import logging
  import jax.numpy
  from scenic.dataset_lib import dataset_utils
  from scenic.dataset_lib import datasets
  import tensorflow
label_desc: Use image node_id 1 for calling a global function with example usage: preprocess_example(example, dtype) and returns: example_out