MCPcopy Create free account
hub / github.com/RenderKit/oidn / __init__

Method __init__

training/dataset.py:319–354  ·  view source on GitHub ↗
(self, cfg, name)

Source from the content-addressed store, hash-verified

317
318class PreprocessedDataset(Dataset):
319 def __init__(self, cfg, name):
320 super(PreprocessedDataset, self).__init__()
321
322 if not name:
323 self.samples = []
324 self.num_images = 0
325 return
326
327 # Check whether the preprocessed images have all required features
328 data_dir = get_preproc_data_dir(cfg, name)
329 data_cfg = load_config(data_dir)
330
331 self.tile_size = cfg.tile_size
332
333 # Get the features
334 self.features = cfg.features
335 self.main_feature = get_main_feature(cfg.features)
336 self.aux_features = get_aux_features(cfg.features)
337 self.clean_aux = cfg.clean_aux and self.aux_features
338
339 # Get the channels
340 self.channels = get_dataset_channels(cfg.features)
341 self.all_channels = get_dataset_channels(data_cfg.features)
342 self.num_main_channels = len(get_model_channels(self.main_feature))
343
344 # Get the image samples
345 samples_filename = os.path.join(data_dir, 'samples.json')
346 self.samples = load_json(samples_filename)
347 self.num_images = len(self.samples)
348
349 if self.num_images == 0:
350 return
351
352 # Create the memory mapping based image reader
353 tza_filename = os.path.join(data_dir, 'images.tza')
354 self.images = tza.Reader(tza_filename)
355
356## -----------------------------------------------------------------------------
357## Training dataset

Callers

nothing calls this directly

Calls 8

get_preproc_data_dirFunction · 0.85
load_configFunction · 0.85
get_main_featureFunction · 0.85
get_aux_featuresFunction · 0.85
get_dataset_channelsFunction · 0.85
get_model_channelsFunction · 0.85
load_jsonFunction · 0.85
__init__Method · 0.45

Tested by

no test coverage detected