import os def create_mirror_structure(source_dir, target_dir): # if not os.path.exists(source_dir): raise ValueError(f"Source directory {source_dir} does not exist.") # for root, dirs, files in os.walk(source_dir, topdown=False): # for dir in dirs: relative_path = os.path.relpath(os.path.join(root, dir), source_dir) # target_subdir = os.path.join(target_dir, relative_path) if not os.path.exists(target_subdir): os.makedirs(target_subdir) # source_directory = '/mnt/RHLH-LVMs/Dataset_Demo/Town_demo_house' # target_directory = '/mnt/RHLH-LVMs/Dataset_Demo/Town_demo_house_copy' # create_mirror_structure(source_directory, target_directory)