You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

remove_duplicate_patches.py 468B

2 years ago
12345678910111213
  1. import os
  2. import shutil
  3. if __name__ == '__main__':
  4. duplicate_info_file_path = "duplicate_image.txt"
  5. with open(duplicate_info_file_path, "r") as file:
  6. for line in file.readlines():
  7. folder_id = line.split(",")[0]
  8. folder_path = os.path.join("./patches", folder_id)
  9. if os.path.exists(folder_path):
  10. shutil.rmtree(folder_path)
  11. print("deleted")
  12. else:
  13. print("no")