MCPcopy Create free account
hub / github.com/ElliotVincent/SitsSCD / __init__

Method __init__

data/data.py:181–213  ·  view source on GitHub ↗
(
            self,
            path,
            split="train",
            domain_shift=False,
            num_channels=4,
            num_classes=7,
            img_size=128,
            true_size=1024,
            train_length=6,
            date_aug_range=2
    )

Source from the content-addressed store, hash-verified

179
180class DynamicEarthNet(SitsDataset):
181 def __init__(
182 self,
183 path,
184 split="train",
185 domain_shift=False,
186 num_channels=4,
187 num_classes=7,
188 img_size=128,
189 true_size=1024,
190 train_length=6,
191 date_aug_range=2
192 ):
193
194 super(DynamicEarthNet, self).__init__(path=path,
195 split=split,
196 domain_shift=domain_shift,
197 num_channels=num_channels,
198 num_classes=num_classes,
199 img_size=img_size,
200 true_size=true_size,
201 train_length=train_length)
202 """Initializes the dataset.
203 Args:
204 path (str): path to the dataset
205 split (str): split to use (train, val, test)
206 domain_shift (bool): if val/test, whether we are in a domain shift setting or not
207 """
208 self.date_aug_range = date_aug_range
209 self.monthly_dates = get_monthly_dates_dict()
210 self.gt, self.sits_ids = self.load_ground_truth(split)
211 self.month_list = [list(range(24)) for _ in range(self.gt.shape[0])]
212 self.mean = torch.tensor([83.1029, 80.7615, 69.3328, 133.8648], dtype=torch.float16).reshape(4, 1, 1)
213 self.std = torch.tensor([33.2714, 25.5288, 23.9868, 30.5591], dtype=torch.float16).reshape(4, 1, 1)
214
215 def load_data(self, sits_number, sits_id, months, curr_sits_path):
216 data = torch.zeros((len(months), self.num_channels, self.true_size, self.true_size), dtype=torch.float16)

Callers

nothing calls this directly

Calls 3

get_monthly_dates_dictFunction · 0.85
load_ground_truthMethod · 0.80
__init__Method · 0.45

Tested by

no test coverage detected