code: def main():
      parser = argparse.ArgumentParser()
      parser.add_argument("--dataset", choices=("sbd", "coco"))
      parser.add_argument("--model", choices=sorted(models.keys()))
      parser.add_argument("--pretrained-model")
      parser.add_argument("--batchsize", type=int)
      parser.add_argument("--gpu", type=int, default=-1)
      args = parser.parse_args()
  
      dataset, eval_, model, batchsize = setup(
          args.dataset,
          args.model,
          args.pretrained_model,
          args.batchsize,
      )
  
      if args.gpu >= 0:
          chainer.cuda.get_device_from_id(args.gpu).use()
          model.to_gpu()
  
      iterator = iterators.MultithreadIterator(
          dataset, batchsize, repeat=False, shuffle=False
      )
  
      in_values, out_values, rest_values = apply_to_iterator(
          model.predict, iterator, hook=ProgressHook(len(dataset))
      )
      # delete unused iterators explicitly
      del in_values
  
      eval_(out_values, rest_values)
  
file_path: chainercv/examples/instance_segmentation/eval_instance_segmentation.py
imports: import argparse
  import chainer
  from chainer import iterators
  from chainercv.datasets import coco_instance_segmentation_label_names
  from chainercv.datasets import COCOInstanceSegmentationDataset
  from chainercv.datasets import sbd_instance_segmentation_label_names
  from chainercv.datasets import SBDInstanceSegmentationDataset
  from chainercv.evaluations import eval_instance_segmentation_coco
  from chainercv.evaluations import eval_instance_segmentation_voc
  from chainercv.experimental.links import FCISResNet101
  from chainercv.links import MaskRCNNFPNResNet101
  from chainercv.links import MaskRCNNFPNResNet50
  from chainercv.utils import apply_to_iterator
  from chainercv.utils import ProgressHook
label_desc: Use image node_id 2 for calling a global function with example usage: main() without return types