If your dataset contains multiple classes (e.g., class A and B) and you prefer not to duplicate images, you can organize masks into class-specific subdirectories:
If your dataset contains multiple classes (e.g., class A and B) and you prefer not to duplicate images, you can organize masks into class-specific subdirectories:
```
```
path_to_data_folder/
path_to_data_folder/
├── images/
├── images/ # Input images (any supported format)
│ └── img1.tif
│ └── img1.bmp
└── masks/
└── masks/
├── A/ # Masks for class A
├── A/ # Masks for class A (any supported format)
│ ├── img1_mask.tif
│ ├── img1_mask.png
│ └── ...
│ └── …
└── B/ # Masks for class B
└── B/ # Masks for class B (any supported format)
├── img1_mask.tif
├── img1_mask.jpeg
└── ...
└── …
```
```
In this case, set the `masks_subdir` field in your dataset configuration to the name of the mask subdirectory (e.g., `"A"` or `"B"`).
In this case, set the `masks_subdir` field in your dataset configuration to the name of the mask subdirectory (e.g., `"A"` or `"B"`).
**Supported file formats**: Image and mask files can have any of these extensions:
`tif`, `tiff`, `png`, `jpg`, `bmp`, `jpeg`.
**Mask format**: Instance masks should be provided for multi-label segmentation with channel-last ordering, i.e., each mask array must have shape `(H, W, C)`.
**Mask format**: Instance masks should be provided for multi-label segmentation with channel-last ordering, i.e., each mask array must have shape `(H, W, C)`.