From 0ef8ed1a647e6d620d1720016843d5508c429918 Mon Sep 17 00:00:00 2001 From: valhassan Date: Thu, 22 Feb 2024 11:57:35 -0500 Subject: [PATCH] Update SegmentationDataset class constructor --- dataset/create_dataset.py | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/dataset/create_dataset.py b/dataset/create_dataset.py index b5d47b59..3007de5f 100644 --- a/dataset/create_dataset.py +++ b/dataset/create_dataset.py @@ -26,7 +26,30 @@ class SegmentationDataset(Dataset): - """Semantic segmentation dataset based on input csvs listing pairs of imagery and ground truth patches as .tif.""" + """Semantic segmentation dataset based on input csvs listing pairs of imagery and ground truth patches as .tif. + + Args: + dataset_list_path (str): The path to the dataset list file. + num_bands (int): The number of bands in the imagery. + dontcare (Optional[int]): The value to be ignored in the label. + max_sample_count (Optional[int]): The maximum number of samples to load from the dataset. + radiom_transform (Optional[Callable]): The radiometric transform function to be applied to the samples. + geom_transform (Optional[Callable]): The geometric transform function to be applied to the samples. + totensor_transform (Optional[Callable]): The transform function to convert samples to tensors. + debug (bool): Whether to enable debug mode. + + Attributes: + max_sample_count (int): The maximum number of samples to load from the dataset. + num_bands (int): The number of bands in the imagery. + radiom_transform (Optional[Callable]): The radiometric transform function to be applied to the samples. + geom_transform (Optional[Callable]): The geometric transform function to be applied to the samples. + totensor_transform (Optional[Callable]): The transform function to convert samples to tensors. + debug (bool): Whether debug mode is enabled. + dontcare (Optional[int]): The value to be ignored in the label. + list_path (str): The path to the dataset list file. + assets (List[Dict[str, str]]): The list of filepaths to images and labels. + + """ def __init__(self, dataset_list_path, @@ -37,7 +60,6 @@ def __init__(self, geom_transform=None, totensor_transform=None, debug=False): - # note: if 'max_sample_count' is None, then it will be read from the dataset at runtime self.max_sample_count = max_sample_count self.num_bands = num_bands self.radiom_transform = radiom_transform