Hi @ptrblck,
It seems to be working almost perfectly! Thank you very much. The only 2 issues is the colour background we added is white:

And when I test it for tall image (height > width), it crashes with the following error:
The expanded size of the tensor (416) must match the existing size (312) at non-singleton dimension 3.  Target sizes: [5, 3, 234, 416].  Tensor sizes: [3, 416, 312]