From 18c1da087e270026da7ee9d8c697fed1172cf98c Mon Sep 17 00:00:00 2001 From: Xintao Date: Fri, 18 Sep 2020 23:48:26 +0800 Subject: [PATCH] add paths_from_folder to data util --- basicsr/data/util.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/basicsr/data/util.py b/basicsr/data/util.py index 798d368..50245ac 100644 --- a/basicsr/data/util.py +++ b/basicsr/data/util.py @@ -246,6 +246,21 @@ def paired_paths_from_folder(folders, keys, filename_tmpl): return paths +def paths_from_folder(folder): + """Generate paths from folder. + + Args: + folder (str): Folder path. + + Returns: + list[str]: Returned path list. + """ + + paths = list(mmcv.scandir(folder)) + paths = [osp.join(folder, path) for path in paths] + return paths + + def generate_gaussian_kernel(kernel_size=13, sigma=1.6): """Generate Gaussian kernel used in `duf_downsample`.