code: def run(model_path, image_path):
      predictor = tp.OfflinePredictor(
          tp.PredictConfig(
              model=Model(),
              session_init=tp.SmartInit(model_path),
              input_names=["image"],
              output_names=["saliency"],
          )
      )
      im = cv2.imread(image_path)
      assert im is not None and im.ndim == 3, image_path
  
      # resnet expect RGB inputs of 224x224x3
      im = cv2.resize(im, (IMAGE_SIZE, IMAGE_SIZE))
      im = im.astype(np.float32)[:, :, ::-1]
  
      saliency_images = predictor(im)[0]
  
      abs_saliency = np.abs(saliency_images).max(axis=-1)
      pos_saliency = np.maximum(0, saliency_images)
      neg_saliency = np.maximum(0, -saliency_images)
  
      pos_saliency -= pos_saliency.min()
      pos_saliency /= pos_saliency.max()
      cv2.imwrite("pos.jpg", pos_saliency * 255)
  
      neg_saliency -= neg_saliency.min()
      neg_saliency /= neg_saliency.max()
      cv2.imwrite("neg.jpg", neg_saliency * 255)
  
      abs_saliency = viz.intensity_to_rgb(abs_saliency, normalize=True)[
          :, :, ::-1
      ]  # bgr
      cv2.imwrite("abs-saliency.jpg", abs_saliency)
  
      rsl = im * 0.2 + abs_saliency * 0.8
      cv2.imwrite("blended.jpg", rsl)
  
file_path: tensorpack/examples/Saliency/saliency-maps.py
imports: import numpy
  import sys
  from contextlib import contextmanager
  import cv2
  import tensorflow
  import tensorflow.contrib.slim
  from tensorflow.contrib.slim.nets import resnet_v1
  import tensorpack
  import tensorpack.utils.viz
  from tensorpack.tfutils import get_tf_version_tuple
label_desc: Use image node_id 3 for calling a global function with example usage: run(model_path, image_path) without return types