CSVDatasetDetection

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

Csv dataset for detection

csv_path

path to csv file with paths of images

Type:

str

return_label

if True return dict with two keys (image, annotations), 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/names 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

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”: …, “annotations”: …}

Return type:

Dict