Applying transforms for 4D or bigger dimension image


I would like to apply random size crop for image data which have bigger dimension than 3D.
(Such as RGBD or RGB+alpha).

If I use random size crop for each single dimension and merge into 4D x H x W tensor, size or crop position is inconsistent since randomize is done per each dimension.

On the other hand, If I make H x W x 4D vector using numpy, then applied random size crop, channels which exceeded 3 seems to be eliminated.

In those cases, how should I deal with it?
Any comments would be appreciated.


someone sent this PR that will help you: