check_folders.py 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. import argparse
  2. import os
  3. folders = [
  4. "allensville",
  5. "beechwood",
  6. "benevolence",
  7. "coffeen",
  8. "collierville",
  9. "corozal",
  10. "cosmos",
  11. "darden",
  12. "forkland",
  13. "hanson",
  14. "hiteman",
  15. "ihlen",
  16. "klickitat",
  17. "lakeville",
  18. "leonardo",
  19. "lindenwood",
  20. "markleeville",
  21. "marstons",
  22. "mcdade",
  23. "merom",
  24. "mifflinburg",
  25. "muleshoe",
  26. "newfields",
  27. "noxapater",
  28. "onaga",
  29. "pinesdale",
  30. "pomaria",
  31. "ranchester",
  32. "shelbyville",
  33. "stockman",
  34. "tolstoy",
  35. "uvalda",
  36. ]
  37. TASKS = {
  38. 's': 'segment_semantic',
  39. 'd': 'depth_zbuffer',
  40. 'n': 'normal',
  41. 'N': 'normal2',
  42. 'k': 'keypoints2d',
  43. 'e': 'edge_occlusion',
  44. 'r': 'reshading',
  45. 't': 'edge_texture',
  46. 'a': 'rgb',
  47. 'c': 'principal_curvature'
  48. }
  49. def parse_tasks(task_str):
  50. tasks = []
  51. for char in task_str:
  52. tasks.append(TASKS[char])
  53. return tasks
  54. def run():
  55. parser = argparse.ArgumentParser(description='Extract')
  56. parser.add_argument("--dir", type=str)
  57. parser.add_argument('--tasks', type=str)
  58. args = parser.parse_args()
  59. tasks = parse_tasks(args.tasks)
  60. for f in folders:
  61. for t in tasks:
  62. p = os.path.join(args.dir, t, f)
  63. try:
  64. print(f"{t}-{f}: {len(os.listdir(p))}")
  65. except Exception as e:
  66. print(e)
  67. print()
  68. if __name__ == '__main__':
  69. run()