dataset_utils
check_leaf_folders_have_n(data_dir, n=200)
Recursively find all leaf folders under data_dir. A leaf folder is one that contains only files (no subdirectories). For each leaf folder, check it has exactly n files. Args: data_dir (str): The root directory to start searching. n (int): The exact number of files each leaf folder should have. Returns: Tuple[dict, int]: A tuple containing: - A dictionary mapping leaf folder paths to their file counts. - The total file count across all leaf folders.
Source code in OmniGibson/omnigibson/eval/utils/dataset_utils.py
fix_permissions(root_dir)
Recursively set rw-rw-r-- for all files owned by the current user.
Source code in OmniGibson/omnigibson/eval/utils/dataset_utils.py
makedirs_with_mode(path, mode=1533)
Recursively create directories with specified mode applied to all newly created dirs. Args: path (str): The directory path to create. mode (int): The mode to apply to newly created directories.