code: def predict(model_name):
      if request.method == "GET":
          return jsonify(error="Use POST method to send image."), 400
  
      try:
          image_array = get_image()
      except ValueError:
          return jsonify(error="Missing image"), 400
      except OSError:
          return jsonify(error="Incompatible file type"), 400
  
      total_predictions = request.args.get("total")
      if total_predictions is not None:
          try:
              total_predictions = int(total_predictions)
          except ValueError:
              total_predictions = None
  
      # Wait for the model to finish loading.
      NETWORK_START_THREAD.join()
  
      objects = PREDICTOR_NETWORK.predict_image(image_array)
      objects = objects[:total_predictions]
  
      return jsonify({"objects": objects})
  
file_path: luminoth/luminoth/tools/server/web.py
imports: import click
  import tensorflow
  from flask import Flask, jsonify, request, render_template
  from threading import Thread
  from PIL import Image
  from six.moves import _thread
  from luminoth.tools.checkpoint import get_checkpoint_config
  from luminoth.utils.config import get_config, override_config_params
  from luminoth.utils.predicting import PredictorNetwork
label_desc: Use image node_id 3 for calling a global function with example usage: predict(model_name) and returns: jsonify, jsonify,  int, jsonify,  int, jsonify,  int