code: def get_boxes(
      model, val_set, num_images=0, image_dir=None, score_threshold=0.6
  ):
      n = 0
      all_boxes = []
      all_gt_boxes = []
      with tqdm(total=val_set.ndata) as pbar:  # progress bar
          for img, (
              gt_boxes,
              gt_classes,
              num_gt_boxes,
              difficult,
              im_shape,
          ) in val_set:
              outputs = model.fprop(img, inference=True)
  
              for k, boxes in enumerate(outputs):
                  pbar.update(1)
  
                  all_boxes.append(boxes)
  
                  ngt = num_gt_boxes[0, k]
                  gtb = gt_boxes[:, k].reshape((-1, 4))
  
                  # retrieve gt boxes
                  # we add a extra column to track detections during the AP calculation
                  detected = np.array([False] * ngt)
                  gtb = np.hstack(
                      [
                          gtb[:ngt],
                          gt_classes[:ngt, k][:, np.newaxis],
                          difficult[:ngt, k][:, np.newaxis],
                          detected[:, np.newaxis],
                      ]
                  )
  
                  all_gt_boxes.append(gtb)
  
                  # plot images if needed
                  if n < num_images:
                      gt_boxes = np.copy(
                          gt_boxes.reshape((-1, 4, val_set.be.bsz))
                      )
                      boxes = np.copy(boxes)
                      ngt = num_gt_boxes[0, k]
  
                      img = plot_image(
                          img=img[:, k].get(),
                          im_shape=im_shape[:, k],
                          gt_boxes=gt_boxes[:ngt, :, k],
                          boxes=boxes,
                          score_threshold=score_threshold,
                      )
  
                      file_name = os.path.join(
                          image_dir, "image_{}.jpg".format(n)
                      )
                      img.save(file_name)
                      n = n + 1
  
      return (all_boxes, all_gt_boxes)
  
file_path: neon/examples/ssd/inference.py
imports: from neon.backends import gen_backend
  from neon.util.argparser import NeonArgparser
  from neon.models.model import Model
  import numpy
  from ssd_container import SSD
  from util.voc_eval import voc_eval
  from tqdm import tqdm
  import json
  from ssd_dataloader import build_dataloader
  import pickle
  import os
  from sys import exit
  from util.util import plot_image
  from collections import OrderedDict
label_desc: Use image node_id 1 for calling a global function with example usage: get_boxes(model, val_set, num_images, image_dir, score_threshold) and returns: all_boxes,  all_gt_boxes