本文共 144 字,大约阅读时间需要 1 分钟。
由(326, 474, 3) 变为 (3, 326, 474) img = np.transpose(img, (2,0,1)) (326, 474, 3)还是(326, 474, 3),只不过最后的3的channel由BGR变为RGB(右移一位) img = img[:,:,::-1]
img = np.transpose(img, (2,0,1))
img = img[:,:,::-1]
转载地址:http://uhygf.baihongyu.com/