code: def get_decode_jpeg_and_inception_crop(
      resize_size=None,
      area_min=5,
      area_max=100,
      aspect_ratio_range=None,
      resize_method=tf2.image.ResizeMethod.BILINEAR,
  ):
      """Decode jpeg string and make inception-style image crop.
  
      Inception-style crop is a random image crop (its size and aspect ratio are
      random) that was used for training Inception models, see
      https://www.cs.unc.edu/~wliu/papers/GoogLeNet.pdf.
  
      Args:
        resize_size: Resize image to [resize_size, resize_size] after crop.
        area_min: minimal crop area.
        area_max: maximal crop area.
        aspect_ratio_range: An optional list of floats. Defaults to [0.75, 1.33].
          The cropped area of the image must have an aspect ratio = width / height
          within this range.
        resize_method: The type of interpolation to apply when resizing. Valid
          values those accepted by tf.image.resize.
  
      Returns:
        A function, that applies inception crop.
      """
  
      def _inception_crop(
          image_data,
      ):  # pylint: disable=missing-docstring
          shape = tf.image.extract_jpeg_shape(image_data)
          begin, size, _ = tf.image.sample_distorted_bounding_box(
              shape,
              tf.zeros([0, 0, 4], tf.float32),
              area_range=(area_min / 100, area_max / 100),
              min_object_covered=0,  # Don't enforce a minimum area.
              aspect_ratio_range=aspect_ratio_range,
              use_image_if_no_bounding_boxes=True,
          )
  
          # Crop the image to the specified bounding box.
          offset_y, offset_x, _ = tf.unstack(begin)
          target_height, target_width, _ = tf.unstack(size)
          crop_window = tf.stack(
              [offset_y, offset_x, target_height, target_width]
          )
          image = tf.image.decode_and_crop_jpeg(
              image_data, crop_window, channels=3
          )
  
          if resize_size:
              image = get_resize(
                  [resize_size, resize_size], resize_method
              )({"image": image})["image"]
  
          return image
  
      return _inception_crop
  
imports: from typing import Optional, Tuple
  import numpy
  from scenic.dataset_lib.big_transfer.preprocessing import autoaugment
  from scenic.dataset_lib.big_transfer.preprocessing import utils
  from scenic.dataset_lib.big_transfer.registry import Registry
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_addons import image
label_desc: Use image node_id 12 for calling a global function with example usage: get_decode_jpeg_and_inception_crop(resize_size, area_min, area_max, aspect_ratio_range, resize_method) and returns: _inception_crop, image