code: def run(path):
      input_api = InputQueue()
      base_path = path
  
      if not base_path:
          raise EOFError("You have to set your image path")
      output_api = OutputQueue()
      output_api.dequeue()
      paths = {
          "cat": os.path.join(base_path, "cat1.jpeg"),
          "dog": os.path.join(base_path, "dog1.jpeg"),
          "fish": os.path.join(base_path, "fish1.jpeg"),
      }
      for key, p in paths.items():
          if not p.endswith("jpeg"):
              continue
          img = cv2.imread(p)
          img = cv2.resize(img, (224, 224))
          data = cv2.imencode(".jpg", img)[1]
          img_encoded = base64.b64encode(data).decode("utf-8")
          result = input_api.enqueue(key, t={"b64": img_encoded})
  
      time.sleep(10)
  
      cat_image_prediction = output_api.query("cat")
      print("cat prediction layer shape: ", cat_image_prediction.shape)
      class_idx = np.argmax(cat_image_prediction)
      print(
          "the class index of prediction of cat image result: ",
          class_idx,
      )
  
      # get all result and dequeue
      result = output_api.dequeue()
      for k in result.keys():
          prediction = result[k]
          # this prediction is the same as the cat_image_prediction above
          print(k, "prediction layer shape: ", prediction.shape)
          class_idx = np.argmax(prediction)
          print(
              "the class index of prediction of "
              + k
              + " image result: ",
              class_idx,
          )
  
file_path: analytics-zoo/docker/cluster-serving/image_classification_and_object_detection_quick_start.py
imports: from zoo.serving.client import InputQueue, OutputQueue
  import os
  import cv2
  import time
  from optparse import OptionParser
  import base64
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: run(path) without return types