Is there a function ImageFolderDataset for segmentation masks

Is there a version of ImageFolderDataset for segmentation masks, or is it only for classification?
FYI:

If you store your mask as an image file, you can grab custom dataset for storing both image and segmentation mask from this tutorial - https://mxnet.incubator.apache.org/tutorials/python/data_augmentation_with_masks.html