code: def predict(model_path, img_path, topN, partition_num):
      print("ImageClassification prediction")
      print("Model Path %s" % model_path)
      print("Image Path %s" % img_path)
      print("Top N : %d" % topN)
      imc = ImageClassifier.load_model(model_path)
      image_set = ImageSet.read(img_path, sc, partition_num)
      output = imc.predict_image_set(image_set)
      labelMap = imc.get_config().label_map()
      predicts = output.get_predict().collect()
      for predict in predicts:
          (uri, probs) = predict
          sortedProbs = [
              (prob, index) for index, prob in enumerate(probs[0])
          ]
          sortedProbs.sort()
          print("Image : %s, top %d prediction result" % (uri, topN))
          for i in range(topN):
              print(
                  "\t%s, %f"
                  % (
                      labelMap[sortedProbs[999 - i][1]],
                      sortedProbs[999 - i][0],
                  )
              )
  
imports: from optparse import OptionParser
  from zoo.common.nncontext import init_nncontext
  from zoo.models.image.imageclassification import *
label_desc: Use image node_id 1 for calling a global function with example usage: predict(model_path, img_path, topN, partition_num) without return types