If you are loading the images with e.g. OpenCV, you would get an array in the shape [H, W, C] and would need to permute it to [C, H, W].
If you want to perform this permutation on the numpy array, you could use np.transpose, while tensor.permute should be used in PyTorch.