numpy util

# change channel
import numpy as np
a=np.array([[1,2,3],[4,5,6]])
print(a)
print(a.shape)

b=a[:,[2,1,0]]
print(b)

注意不是np.transpose,这个是交换axises



new axis,然后复制

np.transpose(np.tile(img, (3,1,1)), (1,2,0))


猜你喜欢

转载自blog.csdn.net/zjucor/article/details/80156461