本文整理汇总了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
示例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
示例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
示例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
示例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
示例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
示例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