def tensor_to_img(img, mean=0, std=1, dtype=np.uint8):
img = img.numpy()
img = np.transpose(img, (1, 2, 0))
img = img * std + mean
img = img.astype(dtype)
# img = cv2.cvtColor(img , cv2.COLOR_BGR2RGB)
return img
## transform (input is numpy array, read in by cv2)
n06_pytorch_utils.py 文件源码
python
阅读 29
收藏 0
点赞 0
评论 0
评论列表
文章目录