Image rotation or image flip and knowledge of new location of certain pixels

This tutorial is quite old by now and written for Theano + Lasagne, however you could reuse the approach for the augmentation of the keypoints as it walks you through it step by step.

If you want to apply the same “random” transformation of two different image tensors, you could use the functional API of torchvision.transforms as described here.