Segmentation dataset datablock api

Still learning how to use the data block API, and I have a segmentation dataset that is formatted like this:


Would anyone please help me out in setting up the data block api?

I could also modify the structure to this if it’s more straightforward:


I think if I do it the second way I can start out like this:

data = (SegmentationItemList.from_folder(path)

But I’m getting hung up on how to set the labels.

Your first folder structure works. You just have to give as path the path where the images are and define an appropriate function that transforms your image path to a mask path.

Hence, your path is: root_path/‘images’