Cannot understand how landmarks are resized in Data loading tutorial

I am new to computer vision and PyTorch. I was going through the PyTorch tutorial - Data Loading and Processing. In rescale function, I cannot understand how the landmarks are being aligned with the resized image.

In code, it says - h and w are swapped for landmarks because for images, x and y axes are axis 1 and 0 respectively - what does this mean ?

  • Also, can someone point out the explanation of the formula to resize images - (height/width)*size
  • One more stupid question - when we say the image is (256 x 254), is 256 the height or width aka is this format (height x width) or (width x height) ?

Thanks in Advance :grin: