CSVDatasetSegmentation

class easypl.datasets.segmentation.csv.CSVDatasetSegmentation(csv_path: str, image_prefix: str = '', mask_prefix: str = '', path_transform: Optional[Callable] = None, transform: Optional = None, return_label: bool = True, image_column: Optional[str] = None, target_column: Optional[str] = None)

Csv dataset for segmentation

csv_path

path to csv file with paths of images

Type:

str

return_label

if True return dict with two keys (image, mask), else return dict with one key (image)

Type:

bool

image_column

column name or None. If None then will be getting the first column

Type:

Optional[str]

target_column

column name or None. If None then will be getting all but the second column

Type:

Optional[str]

image_prefix

path prefix which will be added to paths of images in csv file

Type:

str

mask_prefix

path prefix which will be added to paths of masks in csv file

Type:

str

path_transform

None or function for transform of path. Will be os.path.join(image_prefix, path_transform(image_path))

Type:

Optional[Callable]

transform

albumentations transform class or None

Type:

Optional

__len__() int

Return length of dataset

Return type:

int

__getitem__(idx: int) Dict

Read object of dataset by index

idx

index of object in dataset

Type:

int

Returns:

{“image”: …} or {“image”: …, “mask”: …}

Return type:

Dict