def __init__(self, module, imdb, roidb, test_iter, cfg, rcnn_output_names=None, rpn_output_names=None, logger=None, batch_size=None): self.test_iter = test_iter # Make sure that iterator is instnace of Prefetching iterator if test_iter and not isinstance(test_iter, PrefetchingIter): self.test_iter = PrefetchingIter(self.test_iter) self.scale = test_iter.test_scale self.cfg = cfg self.module = module if test_iter: self.data_names = [k[0] for k in test_iter.provide_data_single] self.rcnn_output_names = rcnn_output_names if not self.rcnn_output_names: self.rcnn_output_names = { 'cls': 'cls_prob_reshape_output', 'bbox': 'bbox_pred_reshape_output', 'im_ids': 'im_ids', 'scale_map': 'scale_prob_output', 'im_info': 'im_info', 'chip_ids': 'chip_ids' } self.rpn_output_names = rpn_output_names if not self.rpn_output_names: self.rpn_output_names = { 'scores': 'rois_score', 'rois': 'rois_output', 'im_ids': 'im_ids' } self.logger = logger self.result_path = imdb.result_path self.num_classes = imdb.num_classes self.class_names = imdb.classes self.num_images = len(roidb) self.imdb_name = imdb.name self.nms_worker = nms_worker(cfg.TEST.NMS, cfg.TEST.NMS_SIGMA) self.batch_size = batch_size self.roidb = roidb self.verbose = len(roidb) > 1 self.thread_pool = None if not self.batch_size: self.batch_size = self.cfg.TEST.BATCH_IMAGES
def __init__(self, module, imdb, roidb, test_iter, cfg, rcnn_output_names=None,rpn_output_names=None, logger=None, batch_size=None): self.test_iter = test_iter # Make sure that iterator is instnace of Prefetching iterator if test_iter and not isinstance(test_iter, PrefetchingIter): self.test_iter = PrefetchingIter(self.test_iter) self.scale = test_iter.test_scale self.cfg = cfg self.module = module if test_iter: self.data_names = [k[0] for k in test_iter.provide_data_single] self.rcnn_output_names = rcnn_output_names if not self.rcnn_output_names: self.rcnn_output_names = { 'cls' : 'cls_prob_reshape_output', 'bbox': 'bbox_pred_reshape_output', 'im_ids': 'im_ids' } self.rpn_output_names = rpn_output_names if not self.rpn_output_names: self.rpn_output_names = { 'scores' : 'rois_score', 'rois': 'rois_output', 'im_ids': 'im_ids' } self.logger = logger self.result_path = imdb.result_path self.num_classes = imdb.num_classes self.class_names = imdb.classes self.num_images = len(roidb) self.imdb_name = imdb.name self.nms_worker = nms_worker(cfg.TEST.NMS, cfg.TEST.NMS_SIGMA) self.batch_size = batch_size self.roidb = roidb self.verbose = len(roidb) > 1 self.thread_pool = None if not self.batch_size: self.batch_size = self.cfg.TEST.BATCH_IMAGES
def __init__(self, module, imdb, roidb, test_iter, cfg, rcnn_output_names=None, rpn_output_names=None, logger=None, batch_size=None): self.test_iter = test_iter self.cfg = cfg self.module = module self.rcnn_output_names = rcnn_output_names if not self.rcnn_output_names: self.rcnn_output_names = { 'cls': 'cls_prob_reshape_output', 'bbox': 'bbox_pred_reshape_output', 'im_ids': 'im_ids' } self.rpn_output_names = rpn_output_names if not self.rpn_output_names: self.rpn_output_names = { 'scores': 'rois_score', 'rois': 'rois_output', 'im_ids': 'im_ids' } self.logger = logger self.result_path = imdb.result_path self.num_classes = imdb.num_classes self.class_names = imdb.classes self.num_images = len(roidb) self.imdb_name = imdb.name self.nms_worker = nms_worker(cfg.TEST.NMS, cfg.TEST.NMS_SIGMA) self.batch_size = batch_size self.roidb = roidb self.verbose = len(roidb) > 1 self.thread_pool = None