def tensor_to_np(tensor): tensor = tensor+1.0 img = tensor.mul(127.5).byte() img = img.cpu().numpy().squeeze(0).transpose((1, 2, 0)) img = np.clip(img, 0,255) return img
tensor_to_numpy
最新推荐文章于 2023-05-05 20:04:08 发布
def tensor_to_np(tensor): tensor = tensor+1.0 img = tensor.mul(127.5).byte() img = img.cpu().numpy().squeeze(0).transpose((1, 2, 0)) img = np.clip(img, 0,255) return img