image from tensor

        filename1=data['a_name'][0]
        image_tensor=inputs[0]
        pdb.set_trace()
        image_numpy = image_tensor.cpu().float().numpy()
        image_numpy = (np.transpose(image_numpy, (1, 2, 0)) + 1) / 2.0 * 255.0

        from PIL import Image
        xx=Image.fromarray(image_numpy.astype(np.uint8))
        xx.show()
        mm=Image.open(filename1)
        mm.show()
posted @ 2019-10-22 14:57  cheatingdeath  阅读(234)  评论(0编辑  收藏  举报