Search code examples
torch

What is the convention for image (RGB) dimensions in Torch


What is the convention for image dimensions in Torch? I'm not a torch user, but am reading some code and I need to know if Torch typically represents an RGB image as {height, width, channels} or as {channels, width, height} as I think I'm reading out of the code I'm looking at.


Solution

  • If you are using the image package (which is the usual way to go), then it usually represents images as tensors of size (channels, height, width).