code: def run_image(model, sess_init, inputs):
      pred_config = PredictConfig(
          model=model,
          session_init=sess_init,
          input_names=["input"],
          output_names=["output"],
      )
      predict_func = OfflinePredictor(pred_config)
      meta = dataset.ILSVRCMeta()
      words = meta.get_synset_words_1000()
  
      transformers = get_inference_augmentor()
      for f in inputs:
          assert os.path.isfile(f)
          img = cv2.imread(f).astype("float32")
          assert img is not None
  
          img = transformers.augment(img)[np.newaxis, :, :, :]
          o = predict_func(img)
          prob = o[0][0]
          ret = prob.argsort()[-10:][::-1]
  
          names = [words[i] for i in ret]
          print(f + ":")
          print(list(zip(names, prob[ret])))
  
file_path: tensorpack/examples/DoReFa-Net/resnet-dorefa.py
imports: import argparse
  import numpy
  import os
  import cv2
  import tensorflow
  from tensorpack import *
  from tensorpack.dataflow import dataset
  from tensorpack.tfutils.varreplace import remap_variables
  from dorefa import get_dorefa
  from imagenet_utils import ImageNetModel, eval_classification, fbresnet_augmentor
label_desc: Use image node_id 2 for calling a global function with example usage: run_image(model, sess_init, inputs) without return types