code: def create_model(num_classes, img_size):
      inputs = tf.keras.layers.Input(shape=(img_size, img_size, 3))
      x = tf.cast(inputs, tf.float32)
      x = tf.keras.applications.resnet50.preprocess_input(x)
      backbone = ResNet50(weights="imagenet")
      backbone.trainable = False
      x = backbone(x)
      x = layers.Dense(512, activation="relu")(x)
      outputs = layers.Dense(num_classes, activation="softmax")(x)
  
      model = Model(inputs=inputs, outputs=outputs)
      model.compile(
          loss="categorical_crossentropy",
          optimizer="adam",
          metrics=["accuracy"],
      )
      return model
  
file_path: BigDL/python/nano/tutorial/training/tensorflow/tensorflow_train_multi_instance.py
imports: import os
  import tensorflow
  from tensorflow.keras import layers
  from tensorflow.keras.applications import ResNet50
  import tensorflow_datasets
  from bigdl.nano.tf.keras import Model
label_desc: Use image node_id 2 for calling a global function with example usage: create_model(num_classes, img_size) and returns: model