basicsr.utils.misc¶
- basicsr.utils.misc.check_resume(opt, resume_iter)[source]¶
Check resume states and pretrain_network paths.
- Parameters:
opt (dict) – Options.
resume_iter (int) – Resume iteration.
- basicsr.utils.misc.mkdir_and_rename(path)[source]¶
mkdirs. If path exists, rename it with timestamp and create a new one.
- Parameters:
path (str) – Folder path.
- basicsr.utils.misc.scandir(dir_path, suffix=None, recursive=False, full_path=False)[source]¶
Scan a directory to find the interested files.
- Parameters:
dir_path (str) – Path of the directory.
suffix (str | tuple(str), optional) – File suffix that we are interested in. Default: None.
recursive (bool, optional) – If set to True, recursively scan the directory. Default: False.
full_path (bool, optional) – If set to True, include the dir_path. Default: False.
- Returns:
A generator for all the interested files with relative paths.