show_images.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:CNNbasedMedicalSegmentation 作者: BRML 项目源码 文件源码
def rotate_transform(im, gt):
    ang = np.random.uniform(-90, 90)
    axes = np.random.permutation(3)[:2]
    rot_im = rotate_scipy(im, ang, axes=axes, order=3, reshape=False)
    rot_gt = groundtruth_(gt)
    rot_gt = np.array([
        rotate_scipy(class_map, ang, axes=axes, order=3, reshape=False) 
        for class_map in np.transpose(rot_gt, (3, 0, 1, 2))])
    rot_gt = rot_gt.argmax(axis=0)
    rot_gt = np.array(rot_gt, dtype='int8')

    return (rot_im, rot_gt)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号