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


Python rpn.get_rpn_testbatch方法代碼示例

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


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

示例1: get_batch

# 需要導入模塊: from rpn import rpn [as 別名]
# 或者: from rpn.rpn import get_rpn_testbatch [as 別名]
def get_batch(self, cur_from=None):
        if cur_from is None:
            cur_from = self.cur
        cur_to = min(cur_from + self.batch_size, self.size)
        roidb = [self.roidb[self.index[i]] for i in range(cur_from, cur_to)]
        if self.has_rpn:
            data, label, im_info = get_rpn_testbatch(roidb, self.cfg)
        else:
            data, label, im_info = get_rcnn_testbatch(roidb, self.cfg)
        data = [[mx.nd.array(idata[name]) for name in self.data_name] for idata in data]
        self.lock_data.acquire()
        self.data = data
        self.im_info = im_info
        self.lock_data.release()

        return data, im_info 
開發者ID:i-pan,項目名稱:kaggle-rsna18,代碼行數:18,代碼來源:loader.py

示例2: get_batch_individual

# 需要導入模塊: from rpn import rpn [as 別名]
# 或者: from rpn.rpn import get_rpn_testbatch [as 別名]
def get_batch_individual(self, cur_from=None):
        if cur_from is None:
            cur_from = self.cur
        cur_to = min(cur_from + self.batch_size, self.size)
        roidb = [self.roidb[self.index[i]] for i in range(cur_from, cur_to)]
        if self.has_rpn:
            data, label, im_info = get_rpn_testbatch(roidb, self.cfg)
        else:
            data, label, im_info = get_rcnn_testbatch(roidb, self.cfg)

        self.lock_data.acquire()
        self.data = [mx.nd.array(data[name]) for name in self.data_name]
        self.im_info = im_info
        self.lock_data.release()

        return data, im_info 
開發者ID:i-pan,項目名稱:kaggle-rsna18,代碼行數:18,代碼來源:loader.py

示例3: get_batch

# 需要導入模塊: from rpn import rpn [as 別名]
# 或者: from rpn.rpn import get_rpn_testbatch [as 別名]
def get_batch(self):
        cur_roidb = self.roidb[self.cur_roidb_index].copy()
        cur_roidb['image'] = cur_roidb['pattern'] % self.cur_frameid
        self.cur_seg_len = cur_roidb['frame_seg_len']
        data, label, im_info = get_rpn_testbatch([cur_roidb], self.cfg)
        if self.cur_frameid == 0: # new video
                self.key_frame_flag = 0
        else:       # normal frame
            self.key_frame_flag = 2

        extend_data = [{'data': data[0]['data'] ,
                        'im_info': data[0]['im_info'],
                        'data_cache': data[0]['data'],
                        'feat_cache': data[0]['data']}]
        self.data = [[mx.nd.array(extend_data[i][name]) for name in self.data_name] for i in xrange(len(data))]
        self.im_info = im_info 
開發者ID:wangshy31,項目名稱:MANet_for_Video_Object_Detection,代碼行數:18,代碼來源:loader.py

示例4: get_init_batch

# 需要導入模塊: from rpn import rpn [as 別名]
# 或者: from rpn.rpn import get_rpn_testbatch [as 別名]
def get_init_batch(self):
        cur_roidb = self.roidb[self.cur_roidb_index].copy()
        cur_roidb['image'] = cur_roidb['pattern'] % self.cur_frameid
        self.cur_seg_len = cur_roidb['frame_seg_len']
        data, label, im_info = get_rpn_testbatch([cur_roidb], self.cfg)
        if self.cur_frameid == 0: # new frame
                self.key_frame_flag = 0
        else:       # normal frame
            self.key_frame_flag = 2

        feat_stride = float(self.cfg.network.RCNN_FEAT_STRIDE)
        extend_data = [{'data': data[0]['data'] ,
                        'im_info': data[0]['im_info'],
                        'data_cache': np.zeros((19, 3, max([v[0] for v in self.cfg.SCALES]), max([v[1] for v in self.cfg.SCALES]))),
                        'feat_cache': np.zeros((19, self.cfg.network.FGFA_FEAT_DIM,
                                                np.ceil(max([v[0] for v in self.cfg.SCALES]) / feat_stride).astype(np.int),
                                                np.ceil(max([v[1] for v in self.cfg.SCALES]) / feat_stride).astype(np.int)))}]
        self.data = [[mx.nd.array(extend_data[i][name]) for name in self.data_name] for i in xrange(len(data))]
        self.im_info = im_info 
開發者ID:wangshy31,項目名稱:MANet_for_Video_Object_Detection,代碼行數:21,代碼來源:loader.py

示例5: get_batch

# 需要導入模塊: from rpn import rpn [as 別名]
# 或者: from rpn.rpn import get_rpn_testbatch [as 別名]
def get_batch(self):
        cur_roidb = self.roidb[self.cur_roidb_index].copy()
        cur_roidb['image'] = cur_roidb['pattern'] % self.cur_frameid
        self.cur_seg_len = cur_roidb['frame_seg_len']
        data, label, im_info = get_rpn_testbatch([cur_roidb], self.cfg)
        if self.key_frameid == self.cur_frameid: # key frame
            self.data_key = data[0]['data'].copy()
            if self.key_frameid == 0:
                self.key_frame_flag = 0
            else:
                self.key_frame_flag = 1
        else:
            self.key_frame_flag = 2
        extend_data = [{'data': data[0]['data'],
                        'im_info': data[0]['im_info'],
                        'data_key': self.data_key,
                        'feat_key': np.zeros((1,self.cfg.network.DFF_FEAT_DIM,1,1))}]
        self.data = [[mx.nd.array(extend_data[i][name]) for name in self.data_name] for i in xrange(len(data))]
        self.im_info = im_info 
開發者ID:msracver,項目名稱:Deep-Feature-Flow,代碼行數:21,代碼來源:loader.py

示例6: get_batch

# 需要導入模塊: from rpn import rpn [as 別名]
# 或者: from rpn.rpn import get_rpn_testbatch [as 別名]
def get_batch(self):
        cur_from = self.cur
        cur_to = min(cur_from + self.batch_size, self.size)
        roidb = [self.roidb[self.index[i]] for i in range(cur_from, cur_to)]
        if self.has_rpn:
            data, label, im_info = get_rpn_testbatch(roidb, self.cfg)
        else:
            data, label, im_info = get_rcnn_testbatch(roidb, self.cfg)
        self.data = [[mx.nd.array(idata[name]) for name in self.data_name] for idata in data]
        self.im_info = im_info 
開發者ID:i-pan,項目名稱:kaggle-rsna18,代碼行數:12,代碼來源:loader.py

示例7: get_batch_individual

# 需要導入模塊: from rpn import rpn [as 別名]
# 或者: from rpn.rpn import get_rpn_testbatch [as 別名]
def get_batch_individual(self):
        cur_from = self.cur
        cur_to = min(cur_from + self.batch_size, self.size)
        roidb = [self.roidb[self.index[i]] for i in range(cur_from, cur_to)]
        if self.has_rpn:
            data, label, im_info = get_rpn_testbatch(roidb, self.cfg)
        else:
            data, label, im_info = get_rcnn_testbatch(roidb, self.cfg)
        self.data = [mx.nd.array(data[name]) for name in self.data_name]
        self.im_info = im_info 
開發者ID:i-pan,項目名稱:kaggle-rsna18,代碼行數:12,代碼來源:loader.py


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