OpenCV numpy.ndarray BGR HWC
matplotlib.pyplot读取图片 numpy.ndarray RGB HWC
PIL读取图片 PIL RGB HWC
tensor RGB CHW
形状
# for torch.Tensor
print(tensor_img.shape())
# # torch.Size([3, 512, 768])
# for numpy.array
print(numpy_img.shape())
# # (512, 768, 3)
# for PIL 先转换成numpy 再看维度
numpy_img = np.array(pil_image)
print(numpy_img.shape())
# # (512, 768, 3)