本文整理汇总了Python中Drawing.cmap方法的典型用法代码示例。如果您正苦于以下问题:Python Drawing.cmap方法的具体用法?Python Drawing.cmap怎么用?Python Drawing.cmap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Drawing
的用法示例。
在下文中一共展示了Drawing.cmap方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ValueError
# 需要导入模块: import Drawing [as 别名]
# 或者: from Drawing import cmap [as 别名]
import pickle
import os
import cv2 as cv
import numpy as np
import sys
import random
sys.path.insert(0, 'Drawing')
from Drawing import imshow
import Drawing as draw
out_folder = 'data'
sub_data = ['images', 'segs']
root = ['full', 'parted']
vgg_size = cfg.vgg_size
if __name__ == '__main__':
mode = sys.argv[1]
if not mode == 'Training' or not mode == 'Validation' or not mode == 'Test': ValueError('Please insert a valid mode between "Training", "Validation" or "Test". Case sensitive.')
lines = open(os.path.join(out_folder, mode+'.txt')).readlines()
randi = random.randint(0, len(lines)-1)
line = lines[randi][:-1].split(' ')
img = cv.imread(line[0])
seg = cv.imread(line[1])
for i in range(2, len(line)): seg += (cv.imread(line[i])*i)
seg = draw.cmap(seg)
imshow(img+seg,0)