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