import tensorflow as tf

            anchors.generate_detections_per_image_op(
                softmax_class_outputs[i], box_outputs[i], box_rois[i],
                features['source_ids'][i], features['image_info'][i],
                params['test_detections_per_image'],
                params['test_rpn_post_nms_topn'], params['test_nms'],
                params['bbox_reg_weights'])
            )
      detections = tf.stack(detections, axis=0)
      if params['include_mask']:
        mask_outputs = mask_rcnn_architecture.mask_rcnn_fn(
            fpn_feats, params, is_training=False, detections=detections)
    else:
      (class_outputs, box_outputs, box_rois, class_targets, box_targets,
       proposal_to_label_map) = mask_rcnn_architecture.faster_rcnn_fn(
