code: def predict_ctl(params):
      image_width = params["image_width"]
      image_height = params["image_height"]
      batch_size = params["batch_size"]
      export_dir = params["export_dir"]
  
      assert export_dir, "--export_dir must be given."
      model_path = export_dir + "/saved_model_rn50.h5"
      assert os.path.exists(model_path)
  
      model = keras.models.load_model(
          model_path,
          custom_objects={
              "PiecewiseConstantDecayWithWarmup": common.PiecewiseConstantDecayWithWarmup
          },
      )
  
      predict_input = image_processing.fake_image_set(
          batch_size, image_height, image_width, with_label=False
      )
      results = model.predict(predict_input, verbose=1, steps=3)
      print(f"The loaded model predicts {results.shape[0]} images.")
  
file_path: DALI/docs/examples/use_cases/tensorflow/resnet-n/nvutils/runner_ctl.py
imports: from builtins import range
  from nvutils import image_processing
  from nvutils import common
  from distutils.version import StrictVersion
  import tensorflow
  import keras
  import os
  import time
  import re
  from keras import backend
  import horovod.tensorflow
label_desc: Use image node_id 2 for calling a global function with example usage: predict_ctl(params) without return types