The used transformations accept a single input only while you are passing the image and target to them.
To allow two inputs, you could refer to the Object Detection tutorial and use the util. functions from references/detection/transforms.py 1.