code: def create_dataset(img_size, batch_size):
      dataset, info = tfds.load(
          "imagenette/320px-v2",
          data_dir="/tmp/data",
          split="validation[:5%]",
          with_info=True,
          as_supervised=True,
      )
  
      num_classes = info.features["label"].num_classes
  
      def preprocessing(img, label):
          return tf.image.resize(img, (img_size, img_size)), tf.one_hot(
              label, num_classes
          )
  
      dataset = dataset.map(preprocessing).batch(batch_size)
      return dataset
  
imports: import numpy
  import tensorflow
  import tensorflow_datasets
  from tensorflow.keras.applications import ResNet50
  from bigdl.nano.tf.keras import InferenceOptimizer
label_desc: Use image node_id 1 for calling a global function with example usage: create_dataset(img_size, batch_size) and returns: dataset, tf,  tf