You can use a mix of both or just the functional API.
The results won’t differ, as it’s basically just coding style.
Internally the torchvision.transforms methods call their functional counterpart.
Just make sure to use random transformation using the functional API for a segmentation use case.