本文整理匯總了Python中utils.image.get_segmentation_image方法的典型用法代碼示例。如果您正苦於以下問題:Python image.get_segmentation_image方法的具體用法?Python image.get_segmentation_image怎麽用?Python image.get_segmentation_image使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類utils.image
的用法示例。
在下文中一共展示了image.get_segmentation_image方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: get_segmentation_test_batch
# 需要導入模塊: from utils import image [as 別名]
# 或者: from utils.image import get_segmentation_image [as 別名]
def get_segmentation_test_batch(segdb, config):
"""
return a dict of train batch
:param segdb: ['image', 'flipped']
:param config: the config setting
:return: data, label, im_info
"""
imgs, seg_cls_gts, segdb = get_segmentation_image(segdb, config)
im_array = imgs
im_info = [np.array([segdb[i]['im_info']], dtype=np.float32) for i in xrange(len(segdb))]
data = [{'data': im_array[i],
'im_info': im_info[i]} for i in xrange(len(segdb))]
label = [{'label':seg_cls_gts[i]} for i in xrange(len(segdb))]
return data, label, im_info
示例2: get_segmentation_train_batch
# 需要導入模塊: from utils import image [as 別名]
# 或者: from utils.image import get_segmentation_image [as 別名]
def get_segmentation_train_batch(segdb, config):
"""
return a dict of train batch
:param segdb: ['image', 'flipped']
:param config: the config setting
:return: data, label, im_info
"""
# assert len(segdb) == 1, 'Single batch only'
assert len(segdb) == 1, 'Single batch only'
imgs, seg_cls_gts, segdb = get_segmentation_image(segdb, config)
im_array = imgs[0]
seg_cls_gt = seg_cls_gts[0]
im_info = np.array([segdb[0]['im_info']], dtype=np.float32)
data = {'data': im_array,
'im_info': im_info}
label = {'label': seg_cls_gt}
return data, label