def region_proposal_roidb(self):
"""
Return the database of regions of interest.
Ground-truth ROIs are also included.
This function loads/saves from/to a cache file to speed up future calls.
"""
cache_file = os.path.join(self.cache_path,
self.name + '_' + cfg.REGION_PROPOSAL + '_region_proposal_roidb.pkl')
if os.path.exists(cache_file):
with open(cache_file, 'rb') as fid:
roidb = cPickle.load(fid)
print '{} roidb loaded from {}'.format(self.name, cache_file)
return roidb
print 'Loading region proposal network boxes...'
model = cfg.REGION_PROPOSAL
roidb = self._load_rpn_roidb(None, model)
print 'Region proposal network boxes loaded'
print '{} region proposals per image'.format(self._num_boxes_proposal / len(self.image_index))
with open(cache_file, 'wb') as fid:
cPickle.dump(roidb, fid, cPickle.HIGHEST_PROTOCOL)
print 'wrote roidb to {}'.format(cache_file)
return roidb
nthu.py 文件源码
python
阅读 19
收藏 0
点赞 0
评论 0
评论列表
文章目录