code: def predict(model_path, image_path, top_n):
      sc = init_nncontext(
          "Image classification inference example using int8 quantized model"
      )
      images = ImageSet.read(image_path, sc, image_codec=1)
      model = ImageClassifier.load_model(model_path)
      output = model.predict_image_set(images)
      label_map = model.get_config().label_map()
  
      # list of images composing uri and results in tuple format
      predicts = output.get_predict().collect()
  
      sequential = Sequential()
      sequential.add(
          Activation("softmax", input_shape=predicts[0][1][0].shape)
      )
      for pre in predicts:
          (uri, probs) = pre
          out = sequential.forward(probs[0])
          sortedProbs = [
              (prob, index) for index, prob in enumerate(out)
          ]
          sortedProbs.sort()
          print("Image : %s, top %d prediction result" % (uri, top_n))
          for i in range(top_n):
              print(
                  "\t%s, %f"
                  % (
                      label_map[sortedProbs[999 - i][1]],
                      sortedProbs[999 - i][0],
                  )
              )
  
file_path: analytics-zoo/pyzoo/zoo/examples/vnni/bigdl/Predict.py
imports: import sys
  from zoo.models.image.imageclassification import ImageClassifier
  from zoo.pipeline.api.keras.layers import Activation
  from zoo.pipeline.api.keras.models import Sequential
  from zoo.feature.image import ImageSet
  from zoo.common.nncontext import init_nncontext
  from optparse import OptionParser
label_desc: Use image node_id 1 for calling a global function with example usage: predict(model_path, image_path, top_n) without return types