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()
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()
标签:tensor,show,Image,filename1,numpy,image 来源: https://www.cnblogs.com/skydaddy/p/11719830.html