code: def get_eval_dataflow(name, shard=0, num_shards=1):
      """
      Args:
          name (str): name of the dataset to evaluate
          shard, num_shards: to get subset of evaluation data
      """
      roidbs = DatasetRegistry.get(name).inference_roidbs()
      logger.info("Found {} images for inference.".format(len(roidbs)))
  
      num_imgs = len(roidbs)
      img_per_shard = num_imgs // num_shards
      img_range = (
          shard * img_per_shard,
          (shard + 1) * img_per_shard
          if shard + 1 < num_shards
          else num_imgs,
      )
  
      # no filter for training
      ds = DataFromListOfDict(
          roidbs[img_range[0] : img_range[1]], ["file_name", "image_id"]
      )
  
      def f(fname):
          im = cv2.imread(fname, cv2.IMREAD_COLOR)
          assert im is not None, fname
          return im
  
      ds = MapDataComponent(ds, f, 0)
      # Evaluation itself may be multi-threaded, therefore don't add prefetch here.
      return ds
  
imports: import copy
  import itertools
  import numpy
  import cv2
  from tabulate import tabulate
  from termcolor import colored
  from tensorpack.dataflow import DataFromList, MapData, MapDataComponent, MultiProcessMapData, MultiThreadMapData, TestDataSpeed, imgaug
  from tensorpack.utils import logger
  from tensorpack.utils.argtools import log_once
  from modeling.model_rpn import get_all_anchors
  from modeling.model_fpn import get_all_anchors_fpn
  from common import CustomResize, DataFromListOfDict, box_to_point4, filter_boxes_inside_shape, np_iou, point4_to_box, polygons_to_mask
  from config import config
  from dataset import DatasetRegistry, register_coco
  from utils.np_box_ops import area
  from utils.np_box_ops import ioa
label_desc: Use image node_id 3 for calling a global function with example usage: get_eval_dataflow(name, shard, num_shards) and returns: ds, im