将tensor转换为numpy
import tensor
import numpy as np
def tensor2img(tensor, out_type=np.uint8, min_max=...2D(H,W), any range, RGB channel order Output: 3D(H,W,C) or 2D(H,W), [0,255], np.uint8 (default) '''
if...and 2D tensor....Unlike matlab, numpy.unit8() WILL NOT round by default.
return img_np.astype(out_type)
版权声明:本文内容由互联网用户自发贡献...如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。