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

Method load_data

data/data.py:215–223  ·  view source on GitHub ↗
(self, sits_number, sits_id, months, curr_sits_path)

Source from the content-addressed store, hash-verified

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)
217 days = [self.random_date_augmentation(month) for month in months]
218 name_rgb = [f'{sits_id}_{day}_rgb.jpeg' for day in days]
219 name_infra = [f'{sits_id}_{day}_infra.jpeg' for day in days]
220 for d, (n_rgb, n_infra) in enumerate(zip(name_rgb, name_infra)):
221 data[d, :3] = torchvision.io.read_image(join(curr_sits_path, n_rgb))
222 data[d, 3] = torchvision.io.read_image(join(curr_sits_path, n_infra))
223 return data, days
224
225 def random_date_augmentation(self, month):
226 if self.split == 'train':

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected