Thanks @ptrblck!
I really don’t know how I was doing it before, but it was causing an error with my own Compose class (which was essentially the same that you posted).
But everything works now, this is the code:
train_transform = transform_Compose([
        transform_ToNumpy(),
        transform_id2Train(),
        transform_Resize((512,1024)),
        transform_RandomHorizontalFlip(),
        transform_ToTensor(),
        transform_Normalize(mean=mean, std=std),
        transform_increaseDim(),
        ])

dataset = Cityscapes(dataset_path, split='train', mode='fine', target_type='semantic', transforms=train_transform)

img, target = dataset[0] #PIL Images

Here the train_transform class takes two arguments.