當前位置: 首頁>>代碼示例>>Python>>正文


Python rpn.assign_anchor方法代碼示例

本文整理匯總了Python中rpn.rpn.assign_anchor方法的典型用法代碼示例。如果您正苦於以下問題:Python rpn.assign_anchor方法的具體用法?Python rpn.assign_anchor怎麽用?Python rpn.assign_anchor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在rpn.rpn的用法示例。


在下文中一共展示了rpn.assign_anchor方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: parfetch

# 需要導入模塊: from rpn import rpn [as 別名]
# 或者: from rpn.rpn import assign_anchor [as 別名]
def parfetch(self, iroidb):
        # get testing data for multigpu
        data, label = get_rpn_batch(iroidb, self.cfg)
        data_shape = {k: v.shape for k, v in data.items()}
        del data_shape['im_info']
        _, feat_shape, _ = self.feat_sym.infer_shape(**data_shape)
        feat_shape = [int(i) for i in feat_shape[0]]

        # add gt_boxes to data for e2e
        data['gt_boxes'] = label['gt_boxes'][np.newaxis, :, :]

        # assign anchor for label
        label = assign_anchor(feat_shape, label['gt_boxes'], data['im_info'], self.cfg,
                              self.feat_stride, self.anchor_scales,
                              self.anchor_ratios, self.allowed_border)
        return {'data': data, 'label': label} 
開發者ID:i-pan,項目名稱:kaggle-rsna18,代碼行數:18,代碼來源:loader.py

示例2: infer_shape

# 需要導入模塊: from rpn import rpn [as 別名]
# 或者: from rpn.rpn import assign_anchor [as 別名]
def infer_shape(self, max_data_shape=None, max_label_shape=None):
        """ Return maximum data and label shape for single gpu """
        if max_data_shape is None:
            max_data_shape = []
        if max_label_shape is None:
            max_label_shape = []
        max_shapes = dict(max_data_shape + max_label_shape)
        input_batch_size = max_shapes['data'][0]
        im_info = [[max_shapes['data'][2], max_shapes['data'][3], 1.0]]
        _, feat_shape, _ = self.feat_sym.infer_shape(**max_shapes)
        label = assign_anchor(feat_shape[0], np.zeros((0, 5)), im_info, self.cfg,
                              self.feat_stride, self.anchor_scales, self.anchor_ratios, self.allowed_border,
                              self.normalize_target, self.bbox_mean, self.bbox_std)
        label = [label[k] for k in self.label_name]
        label_shape = [(k, tuple([input_batch_size] + list(v.shape[1:]))) for k, v in zip(self.label_name, label)]
        return max_data_shape, label_shape 
開發者ID:wangshy31,項目名稱:MANet_for_Video_Object_Detection,代碼行數:18,代碼來源:loader.py

示例3: parfetch

# 需要導入模塊: from rpn import rpn [as 別名]
# 或者: from rpn.rpn import assign_anchor [as 別名]
def parfetch(self, iroidb):
        # get testing data for multigpu
        data, label = get_rpn_triple_batch(iroidb, self.cfg)
        data_shape = {k: v.shape for k, v in data.items()}
        del data_shape['im_info']
        _, feat_shape, _ = self.feat_sym.infer_shape(**data_shape)
        feat_shape = [int(i) for i in feat_shape[0]]

        # add gt_boxes to data for e2e
        data['gt_boxes'] = label['gt_boxes'][np.newaxis, :, :]
        data['occluded'] = label['occluded']
        data['delta_bef_gt'] = label['delta_bef_gt']
        data['delta_aft_gt'] = label['delta_aft_gt']
        # assign anchor for label
        label = assign_anchor(feat_shape, label['gt_boxes'], data['im_info'], self.cfg,
                              self.feat_stride, self.anchor_scales,
                              self.anchor_ratios, self.allowed_border,
                              self.normalize_target, self.bbox_mean, self.bbox_std)
        #print '###################################begin parfetch##########################'
        #print 'data[gt_boxes]', data['gt_boxes']
        #print 'data[delta_bef]', data['delta_bef']
        #print 'data[delta_aft]', data['delta_aft']
        return {'data': data, 'label': label} 
開發者ID:wangshy31,項目名稱:MANet_for_Video_Object_Detection,代碼行數:25,代碼來源:loader.py

示例4: parfetch

# 需要導入模塊: from rpn import rpn [as 別名]
# 或者: from rpn.rpn import assign_anchor [as 別名]
def parfetch(self, iroidb):
        # get testing data for multigpu
        data, label = get_rpn_pair_batch(iroidb, self.cfg)
        data_shape = {k: v.shape for k, v in data.items()}
        del data_shape['im_info']
        _, feat_shape, _ = self.feat_sym.infer_shape(**data_shape)
        feat_shape = [int(i) for i in feat_shape[0]]

        # add gt_boxes to data for e2e
        data['gt_boxes'] = label['gt_boxes'][np.newaxis, :, :]

        # assign anchor for label
        label = assign_anchor(feat_shape, label['gt_boxes'], data['im_info'], self.cfg,
                              self.feat_stride, self.anchor_scales,
                              self.anchor_ratios, self.allowed_border,
                              self.normalize_target, self.bbox_mean, self.bbox_std)
        return {'data': data, 'label': label} 
開發者ID:msracver,項目名稱:Deep-Feature-Flow,代碼行數:19,代碼來源:loader.py

示例5: parfetch

# 需要導入模塊: from rpn import rpn [as 別名]
# 或者: from rpn.rpn import assign_anchor [as 別名]
def parfetch(self, iroidb):
        # get testing data for multigpu
        data, label = get_rpn_triple_batch(iroidb, self.cfg)
        data_shape = {k: v.shape for k, v in data.items()}
        del data_shape['im_info']
        _, feat_shape, _ = self.feat_sym.infer_shape(**data_shape)
        feat_shape = [int(i) for i in feat_shape[0]]

        # add gt_boxes to data for e2e
        data['gt_boxes'] = label['gt_boxes'][np.newaxis, :, :]

        # assign anchor for label
        label = assign_anchor(feat_shape, label['gt_boxes'], data['im_info'], self.cfg,
                              self.feat_stride, self.anchor_scales,
                              self.anchor_ratios, self.allowed_border,
                              self.normalize_target, self.bbox_mean, self.bbox_std)
        return {'data': data, 'label': label} 
開發者ID:msracver,項目名稱:Flow-Guided-Feature-Aggregation,代碼行數:19,代碼來源:loader.py

示例6: parfetch

# 需要導入模塊: from rpn import rpn [as 別名]
# 或者: from rpn.rpn import assign_anchor [as 別名]
def parfetch(self, iroidb):
        # get testing data for multigpu
        data, label = get_rpn_batch(iroidb, self.cfg)
        data_shape = {k: v.shape for k, v in data.items()}
        del data_shape['im_info']
        _, feat_shape, _ = self.feat_sym.infer_shape(**data_shape)
        feat_shape = [int(i) for i in feat_shape[0]]

        # add gt_boxes to data for e2e
        data['gt_boxes'] = label['gt_boxes'][np.newaxis, :, :]

        # assign anchor for label
        label = assign_anchor(feat_shape, label['gt_boxes'], data['im_info'], self.cfg,
                              self.feat_stride, self.anchor_scales,
                              self.anchor_ratios, self.allowed_border,
                              self.normalize_target, self.bbox_mean, self.bbox_std)
        return {'data': data, 'label': label} 
開發者ID:SamvitJ,項目名稱:Accel,代碼行數:19,代碼來源:loader.py

示例7: parfetch

# 需要導入模塊: from rpn import rpn [as 別名]
# 或者: from rpn.rpn import assign_anchor [as 別名]
def parfetch(self, iroidb):
        # get testing data for multigpu
        data, label = get_rpn_batch(iroidb, self.cfg)
        data_shape = {k: v.shape for k, v in data.items()}
        del data_shape['im_info']
        _, feat_shape, _ = self.feat_sym.infer_shape(**data_shape)
        feat_shape = [int(i) for i in feat_shape[0]]

        # add gt_boxes to data for e2e
        data['gt_boxes'] = label['gt_boxes'][np.newaxis, :, :]

        # assign anchor for label
        label = assign_anchor(feat_shape, label['gt_boxes'], data['im_info'], self.cfg,
                              self.feat_stride, self.anchor_scales,
                              self.anchor_ratios, self.allowed_border)
        return {'data': data, 'label': label}

# TODO test this dataloader for quadrangle 
開發者ID:jessemelpolio,項目名稱:Faster_RCNN_for_DOTA,代碼行數:20,代碼來源:loader.py

示例8: infer_shape

# 需要導入模塊: from rpn import rpn [as 別名]
# 或者: from rpn.rpn import assign_anchor [as 別名]
def infer_shape(self, max_data_shape=None, max_label_shape=None):
        """ Return maximum data and label shape for single gpu """
        if max_data_shape is None:
            max_data_shape = []
        if max_label_shape is None:
            max_label_shape = []
        max_shapes = dict(max_data_shape + max_label_shape)
        input_batch_size = max_shapes['data'][0]
        im_info = [[max_shapes['data'][2], max_shapes['data'][3], 1.0]]
        feat_shape = max_shapes['data']
        H = int(np.ceil(feat_shape[2] * 1.0 / self.feat_stride))
        W = int(np.ceil(feat_shape[3] * 1.0 / self.feat_stride))
        _, feat_shape, _ = self.feat_sym.infer_shape(**max_shapes)

        label = assign_anchor(feat_shape[0], np.zeros((0, 5)), im_info, self.cfg,
                              self.feat_stride, self.anchor_scales, self.anchor_ratios, self.allowed_border,
                              self.normalize_target, self.bbox_mean, self.bbox_std)

        label = [label[k] for k in self.label_name]
        label_shape = [(k, tuple([input_batch_size] + list(v.shape[1:]))) for k, v in zip(self.label_name, label)]
        return max_data_shape, label_shape 
開發者ID:happywu,項目名稱:Sequence-Level-Semantics-Aggregation,代碼行數:23,代碼來源:loader.py

示例9: parfetch

# 需要導入模塊: from rpn import rpn [as 別名]
# 或者: from rpn.rpn import assign_anchor [as 別名]
def parfetch(self, iroidb):
        # get testing data for multigpu
        data, label = get_rpn_triple_batch(iroidb, self.cfg)
        data_shape = {k: v.shape for k, v in data.items()}
        del data_shape['im_info']
        _, feat_shape, _ = self.feat_sym.infer_shape(**data_shape)
        feat_shape = [int(i) for i in feat_shape[0]]

        # add gt_boxes to data for e2e
        data['gt_boxes'] = label['gt_boxes'][np.newaxis, :, :]

        # assign anchor for label
        label_f = assign_anchor(feat_shape, label['gt_boxes'], data['im_info'], self.cfg,
                                self.feat_stride, self.anchor_scales,
                                self.anchor_ratios, self.allowed_border,
                                self.normalize_target, self.bbox_mean, self.bbox_std)

        return {'data': data, 'label': label_f} 
開發者ID:happywu,項目名稱:Sequence-Level-Semantics-Aggregation,代碼行數:20,代碼來源:loader.py

示例10: infer_shape

# 需要導入模塊: from rpn import rpn [as 別名]
# 或者: from rpn.rpn import assign_anchor [as 別名]
def infer_shape(self, max_data_shape=None, max_label_shape=None):
        """ Return maximum data and label shape for single gpu """
        if max_data_shape is None:
            max_data_shape = []
        if max_label_shape is None:
            max_label_shape = []
        max_shapes = dict(max_data_shape + max_label_shape)
        input_batch_size = max_shapes['data'][0]
        im_info = [[max_shapes['data'][2], max_shapes['data'][3], 1.0]]
        _, feat_shape, _ = self.feat_sym.infer_shape(**max_shapes)
        label = assign_anchor(feat_shape[0], np.zeros((0, 5)), im_info, self.cfg,
                              self.feat_stride, self.anchor_scales, self.anchor_ratios, self.allowed_border)
        label = [label[k] for k in self.label_name]
        label_shape = [(k, tuple([input_batch_size] + list(v.shape[1:]))) for k, v in zip(self.label_name, label)]
        return max_data_shape, label_shape 
開發者ID:i-pan,項目名稱:kaggle-rsna18,代碼行數:17,代碼來源:loader.py


注:本文中的rpn.rpn.assign_anchor方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。