LLMMultiLabel / openimages_v7 /remove_dir.py
DaYuDaYu's picture
Add files using upload-large-folder tool
0213a4c verified
raw
history blame contribute delete
430 Bytes
import os
import shutil
def remove_dirs_except_tar(root_dir):
for item in os.listdir(root_dir):
item_path = os.path.join(root_dir, item)
if os.path.isdir(item_path):
shutil.rmtree(item_path)
elif item.endswith('.tar'):
continue
if __name__ == "__main__":
root_directory = '/media/data/CC3M/data/openimages_v7/openimages_v7_valid'
remove_dirs_except_tar(root_directory)