MCPcopy Create free account
hub / github.com/pytorch/executorch / get_dataset

Function get_dataset

examples/qualcomm/scripts/edsr.py:88–100  ·  view source on GitHub ↗
(hr_dir: str, lr_dir: str, default_dataset: str, dataset_dir: str)

Source from the content-addressed store, hash-verified

86
87
88def get_dataset(hr_dir: str, lr_dir: str, default_dataset: str, dataset_dir: str):
89 if not (lr_dir and hr_dir) and not default_dataset:
90 raise RuntimeError(
91 "Nither custom dataset is provided nor using default dataset."
92 )
93
94 if (lr_dir and hr_dir) and default_dataset:
95 raise RuntimeError("Either use custom dataset, or use default dataset.")
96
97 if default_dataset:
98 return get_Div2K(dataset_dir)
99
100 return SrDataset(hr_dir, lr_dir)
101
102
103def main(args):

Callers 2

mainFunction · 0.90
mainFunction · 0.70

Calls 2

get_Div2KFunction · 0.85
SrDatasetClass · 0.70

Tested by

no test coverage detected