Train/validation different albumentations transforms for segmentation

Looking at this document:

There is a way to implement albumentations transforms for segmentation, via ItemTransform.

There is a way to implement different albumentations transforms in training vs. validation, via RandTransform.before_call().

What I can’t seem to do is having separate albumentations transforms in training vs validation for a segmentation problem (image + mask). ItemTransform takes tuples, but doesn’t have before_call, so I can’t tell whether it’s training or validation. RandTransform has before_call and I can set split_idx but I don’t see a way to handle image/mask tuples there.

How to do both?