pyiqa.utils.misc ================ .. py:module:: pyiqa.utils.misc Module Contents --------------- .. py:function:: set_random_seed(seed=123) Set random seeds. .. py:function:: get_time_str() .. py:function:: mkdir_and_rename(path) mkdirs. If path exists, rename it with timestamp, create a new one, and move it to archive folder. :param path: Folder path. :type path: str .. py:function:: make_exp_dirs(opt) Make dirs for experiments. .. py:function:: scandir(dir_path, suffix=None, recursive=False, full_path=False) Scan a directory to find the interested files. :param dir_path: Path of the directory. :type dir_path: str :param suffix: File suffix that we are interested in. Default: None. :type suffix: str | tuple(str), optional :param recursive: If set to True, recursively scan the directory. Default: False. :type recursive: bool, optional :param full_path: If set to True, include the dir_path. Default: False. :type full_path: bool, optional :returns: A generator for all the interested files with relative paths. .. py:function:: check_resume(opt, resume_iter) Check resume states and pretrain_network paths. :param opt: Options. :type opt: dict :param resume_iter: Resume iteration. :type resume_iter: int .. py:function:: sizeof_fmt(size, suffix='B') Get human readable file size. :param size: File size. :type size: int :param suffix: Suffix. Default: 'B'. :type suffix: str :returns: Formatted file size. :rtype: str