How to get Segmentation Mask of Pascal VOC Dataset

I am very new to image segmentation .
I tried loading Pascal VOC datasets using torchvision dataset , But in return it gives original image and segmentation image of different colours. But for an image of <C,H,W> what i need is <H,W> masks to let me know which pixel belongs to which class .
How do i get the segmentation mask ?