def process_gt(gt, n_classes, downsize=False):
if downsize:
gt = zoom(gt, 0.5, order=0)
gt = np.asarray(gt, dtype='int8')
gt = np.transpose(gt, (1, 2, 0))
l = np.reshape(gt, (-1,))
l = np.reshape(one_hot(l, n_classes), (-1, n_classes))
return l
评论列表
文章目录