ngaggion commited on
Commit
2211607
·
verified ·
1 Parent(s): afb1d27

Add files using upload-large-folder tool

Browse files
Files changed (50) hide show
  1. Roots/test 3/4/2019-11-07_04-01-24_4.png +3 -0
  2. Roots/test 3/4/2019-11-07_12-01-25_4.png +3 -0
  3. Roots/test 3/4/2019-11-08_00-01-22_4.png +3 -0
  4. Roots/test 3/4/2019-11-08_12-01-24_4.png +3 -0
  5. Roots/test 3/4/2019-11-08_13-01-25_4.png +3 -0
  6. Roots/test 3/4/2019-11-09_05-01-27_4.png +3 -0
  7. Roots/test 3/4/2019-11-09_15-01-27_4.png +3 -0
  8. Roots/test 3/4/2019-11-10_07-01-26_4.png +3 -0
  9. Roots/test 3/4/2019-11-11_12-01-25_4.png +3 -0
  10. Roots/test 3/4/2019-11-11_17-01-25_4.png +3 -0
  11. Roots/test 3/4/2019-11-11_23-01-23_4.png +3 -0
  12. Roots/test 3/4/2019-11-12_10-01-26_4.png +3 -0
  13. Roots/test 3/4/2019-11-12_22-01-12_4.png +3 -0
  14. Roots/test 3/4/2019-11-13_08-01-12_4.png +3 -0
  15. Roots/test 3/4/2019-11-15_15-01-12_4.png +3 -0
  16. Roots/test 3/4/2019-11-16_00-01-11_4.png +3 -0
  17. Roots/test 3/4/2019-11-16_09-01-11_4.png +3 -0
  18. Roots/test 3/4/2019-11-16_18-01-11_4.png +3 -0
  19. Roots/test 3/4/2019-11-17_03-01-11_4.png +3 -0
  20. Roots/test 3/4/2019-11-17_07-01-12_4.png +3 -0
  21. Roots/test 3/4/2019-11-17_09-01-11_4.png +3 -0
  22. Roots/test 3/4/2019-11-17_14-01-12_4.png +3 -0
  23. Roots/test 3/4/2019-11-18_17-01-12_4.png +3 -0
  24. Roots/test 3/4/2019-11-19_05-01-11_4.png +3 -0
  25. Roots/test 3/4/2019-11-19_12-01-11_4.png +3 -0
  26. Roots/test 3/4/2019-11-19_13-01-12_4.png +3 -0
  27. Roots/test 3/4/2019-11-19_20-01-10_4.png +3 -0
  28. Roots/test 3/4/2019-11-19_21-01-10_4.png +3 -0
  29. Roots/test 3/4/2019-11-20_10-01-12_4.png +3 -0
  30. Roots/test 3/4/2019-11-21_00-01-11_4.png +3 -0
  31. Roots/test 3/4/2019-11-21_01-01-11_4.png +3 -0
  32. Roots/test 3/4/2019-11-21_05-01-11_4.png +3 -0
  33. Roots/test 3/4/2019-11-21_19-01-11_4.png +3 -0
  34. Roots/test 3/4/2019-11-21_23-01-11_4.png +3 -0
  35. Roots/test 3/4/2019-11-22_05-01-12_4.png +3 -0
  36. Roots/test 3/4/2019-11-22_12-01-11_4.png +3 -0
  37. Roots/test 3/4/2019-11-22_21-01-12_4.png +3 -0
  38. Roots/test 3/4/2019-11-23_21-01-11_4.png +3 -0
  39. Roots/test 3/4/2019-11-24_00-01-11_4.png +3 -0
  40. Roots/test 3/4/2019-11-24_04-01-11_4.png +3 -0
  41. Roots/test 3/4/2019-11-25_08-01-12_4.png +3 -0
  42. Roots/test 3/4/2019-11-25_13-01-11_4.png +3 -0
  43. Roots/test 3/4/2019-11-26_20-01-10_4.png +3 -0
  44. Roots/test 3/4/2019-11-28_01-01-09_4.png +3 -0
  45. Roots/test 3/4/2019-11-28_02-01-10_4.png +3 -0
  46. Roots/test 3/4/2019-11-28_11-01-10_4.png +3 -0
  47. Roots/test 3/4/2019-11-28_15-01-10_4.png +3 -0
  48. Roots/test 3/4/2019-11-29_16-01-11_4.png +3 -0
  49. Roots/test 3/4/2019-11-29_23-01-10_4.png +3 -0
  50. script.py +108 -0
Roots/test 3/4/2019-11-07_04-01-24_4.png ADDED

Git LFS Details

  • SHA256: 963095761dee338fbe85ddede5ba7de521e7c418897e20317ddb2e5a418f856a
  • Pointer size: 132 Bytes
  • Size of remote file: 2.88 MB
Roots/test 3/4/2019-11-07_12-01-25_4.png ADDED

Git LFS Details

  • SHA256: 6a7e1cc16a347e4eaa202d577942a74b0696fa1e5ac7051043ff9e67caf98fe9
  • Pointer size: 132 Bytes
  • Size of remote file: 2.9 MB
Roots/test 3/4/2019-11-08_00-01-22_4.png ADDED

Git LFS Details

  • SHA256: bc3817548480c8b6306630080294edc1c430f3f7bfdd92196844119df2c76c8a
  • Pointer size: 132 Bytes
  • Size of remote file: 2.92 MB
Roots/test 3/4/2019-11-08_12-01-24_4.png ADDED

Git LFS Details

  • SHA256: 260974f88d84cfc3ebd962da502a97fd719f82489dc83db7f2a73b39b194abdc
  • Pointer size: 132 Bytes
  • Size of remote file: 2.91 MB
Roots/test 3/4/2019-11-08_13-01-25_4.png ADDED

Git LFS Details

  • SHA256: 5192ea1beabf0db4915091426990de3dcd59b69953990036950de4207c645430
  • Pointer size: 132 Bytes
  • Size of remote file: 2.92 MB
Roots/test 3/4/2019-11-09_05-01-27_4.png ADDED

Git LFS Details

  • SHA256: e56f852b0d1aad30a72d289e08fca01ba0d83b90cca8e46c2dc67e49beaec4c0
  • Pointer size: 132 Bytes
  • Size of remote file: 2.93 MB
Roots/test 3/4/2019-11-09_15-01-27_4.png ADDED

Git LFS Details

  • SHA256: c89e0663d49f657d3c448a9d88d3bef66c739914f2b797d2956d4d2e56248766
  • Pointer size: 132 Bytes
  • Size of remote file: 2.93 MB
Roots/test 3/4/2019-11-10_07-01-26_4.png ADDED

Git LFS Details

  • SHA256: a4154274951612e7a95fa82ccbfcb959bae800a05d6cf20778204ce33491f05b
  • Pointer size: 132 Bytes
  • Size of remote file: 2.92 MB
Roots/test 3/4/2019-11-11_12-01-25_4.png ADDED

Git LFS Details

  • SHA256: 508782a7b753f452dbe3c626301e1532c54e092ab67b2fd87cb02948dc6d5bc1
  • Pointer size: 132 Bytes
  • Size of remote file: 2.92 MB
Roots/test 3/4/2019-11-11_17-01-25_4.png ADDED

Git LFS Details

  • SHA256: f4b8a8422d8638c8b20f7e3cc56c97a8816305d2ac54500ba816f27bd5832a34
  • Pointer size: 132 Bytes
  • Size of remote file: 2.9 MB
Roots/test 3/4/2019-11-11_23-01-23_4.png ADDED

Git LFS Details

  • SHA256: d612271e8d54775ae4e51621b63259a108173f408532bb615e20fbc6240d39af
  • Pointer size: 132 Bytes
  • Size of remote file: 2.89 MB
Roots/test 3/4/2019-11-12_10-01-26_4.png ADDED

Git LFS Details

  • SHA256: ab110ce1cc22952c52e3aafe372c50d5219367883a5ddfd16b6d153ec14555a5
  • Pointer size: 132 Bytes
  • Size of remote file: 2.89 MB
Roots/test 3/4/2019-11-12_22-01-12_4.png ADDED

Git LFS Details

  • SHA256: 0918dd73ab90b98ff95786785105377989af2f0f0280030d81a626d4a5afa93c
  • Pointer size: 132 Bytes
  • Size of remote file: 2.88 MB
Roots/test 3/4/2019-11-13_08-01-12_4.png ADDED

Git LFS Details

  • SHA256: 214a9c7f53e6249e0b50f84e3187aa5a2af6a83e68b45408596e03938cfe73e6
  • Pointer size: 132 Bytes
  • Size of remote file: 2.87 MB
Roots/test 3/4/2019-11-15_15-01-12_4.png ADDED

Git LFS Details

  • SHA256: caecb083cd2388f530943fa17d2e9ac920ef17602951dab74c526a1e21090a7d
  • Pointer size: 132 Bytes
  • Size of remote file: 2.84 MB
Roots/test 3/4/2019-11-16_00-01-11_4.png ADDED

Git LFS Details

  • SHA256: 6e659f989d284396819bbc4c67fcc83816e241f65c605b153f5eeccdbd87ce8c
  • Pointer size: 132 Bytes
  • Size of remote file: 2.83 MB
Roots/test 3/4/2019-11-16_09-01-11_4.png ADDED

Git LFS Details

  • SHA256: 3c9eccd7125d1ab1079bfdb6c426455a0a0c70ece7e039c06b436e00ba611eea
  • Pointer size: 132 Bytes
  • Size of remote file: 2.83 MB
Roots/test 3/4/2019-11-16_18-01-11_4.png ADDED

Git LFS Details

  • SHA256: 3aec4f1937fc8b8b31de9b89bb7dfc0942b1432bddbb5f47a8a040e6fd89d732
  • Pointer size: 132 Bytes
  • Size of remote file: 2.84 MB
Roots/test 3/4/2019-11-17_03-01-11_4.png ADDED

Git LFS Details

  • SHA256: 67761eb8609fb130699eea75ae64fad73e5169e8b30a6cac8696e0a7b2fa61c6
  • Pointer size: 132 Bytes
  • Size of remote file: 2.83 MB
Roots/test 3/4/2019-11-17_07-01-12_4.png ADDED

Git LFS Details

  • SHA256: 131e92c93f6ba5525c89641497f84d27b0ee1a4da65694407966d308653a24b2
  • Pointer size: 132 Bytes
  • Size of remote file: 2.84 MB
Roots/test 3/4/2019-11-17_09-01-11_4.png ADDED

Git LFS Details

  • SHA256: 604af0baa9d5cacb96bf1eb338529c69f6b2a3145a7f46f174af4a526980bebe
  • Pointer size: 132 Bytes
  • Size of remote file: 2.84 MB
Roots/test 3/4/2019-11-17_14-01-12_4.png ADDED

Git LFS Details

  • SHA256: cabfd9b93eb65c7041155be9382e757a47983d8957cd0dab31bd82b08f78d0ab
  • Pointer size: 132 Bytes
  • Size of remote file: 2.85 MB
Roots/test 3/4/2019-11-18_17-01-12_4.png ADDED

Git LFS Details

  • SHA256: 2e364e3d9419b1c74cd115e16d219b2d207908e094e1f9a8245c67f0f84a8961
  • Pointer size: 132 Bytes
  • Size of remote file: 2.85 MB
Roots/test 3/4/2019-11-19_05-01-11_4.png ADDED

Git LFS Details

  • SHA256: 0156e50a1a0fb2f026d5e4aba6c9cc493115bb1b6eca35c49bd6a32db1bffa3e
  • Pointer size: 132 Bytes
  • Size of remote file: 2.84 MB
Roots/test 3/4/2019-11-19_12-01-11_4.png ADDED

Git LFS Details

  • SHA256: b6285b5307a0c38e2b865ce33f24561e2feef0d57e264ff5f6f4f5a9e386fca5
  • Pointer size: 132 Bytes
  • Size of remote file: 2.84 MB
Roots/test 3/4/2019-11-19_13-01-12_4.png ADDED

Git LFS Details

  • SHA256: f0e813b2333fcf3de654a2316d7f9a86bcf5ed33f2edc64d434df565e0966ef8
  • Pointer size: 132 Bytes
  • Size of remote file: 2.85 MB
Roots/test 3/4/2019-11-19_20-01-10_4.png ADDED

Git LFS Details

  • SHA256: 8361bc3c5ca6a4106376035d42c3b8e3200ba14e98580ec821422c9908151a6b
  • Pointer size: 132 Bytes
  • Size of remote file: 2.85 MB
Roots/test 3/4/2019-11-19_21-01-10_4.png ADDED

Git LFS Details

  • SHA256: fcfc3616954f5cc37cc299ee308db1f4102daaa0d53310aa534ce9fe6623a8cc
  • Pointer size: 132 Bytes
  • Size of remote file: 2.84 MB
Roots/test 3/4/2019-11-20_10-01-12_4.png ADDED

Git LFS Details

  • SHA256: 1644b43cf5cb0f150b3bb269835b4cc6ae0db0957839e096c18a869a0d7573da
  • Pointer size: 132 Bytes
  • Size of remote file: 2.84 MB
Roots/test 3/4/2019-11-21_00-01-11_4.png ADDED

Git LFS Details

  • SHA256: 0e0bc311bf2660898eaf9739c6904ca6b3f68c69a621b55fd6d01b3acad3fe5e
  • Pointer size: 132 Bytes
  • Size of remote file: 2.85 MB
Roots/test 3/4/2019-11-21_01-01-11_4.png ADDED

Git LFS Details

  • SHA256: ba842738ce0b4cbe132e2d96605fc8a686193cb91b48a702ac162b46cebb48e3
  • Pointer size: 132 Bytes
  • Size of remote file: 2.84 MB
Roots/test 3/4/2019-11-21_05-01-11_4.png ADDED

Git LFS Details

  • SHA256: 1caaee2c9cccbcf19e775538c5ef2c271a727b8f9926f21300adc4d34d688289
  • Pointer size: 132 Bytes
  • Size of remote file: 2.85 MB
Roots/test 3/4/2019-11-21_19-01-11_4.png ADDED

Git LFS Details

  • SHA256: 932a5f1ce54e89ed66558ff02e1b17d33dc35fafca839d784ebcc589ac2279c8
  • Pointer size: 132 Bytes
  • Size of remote file: 2.86 MB
Roots/test 3/4/2019-11-21_23-01-11_4.png ADDED

Git LFS Details

  • SHA256: d49cbf67b191f67aabcd0d85833874b197a0cc4f9c0f664355111d82d4bcfdde
  • Pointer size: 132 Bytes
  • Size of remote file: 2.85 MB
Roots/test 3/4/2019-11-22_05-01-12_4.png ADDED

Git LFS Details

  • SHA256: 4e12438edee90cc9add68a34b33771f30b37083cbe2d65f31e93606d2cfd3aa5
  • Pointer size: 132 Bytes
  • Size of remote file: 2.85 MB
Roots/test 3/4/2019-11-22_12-01-11_4.png ADDED

Git LFS Details

  • SHA256: 68a6cfe1a455bc9354e9c188cd80ba2ae25f7d327701624644bb836f4d48d10b
  • Pointer size: 132 Bytes
  • Size of remote file: 2.85 MB
Roots/test 3/4/2019-11-22_21-01-12_4.png ADDED

Git LFS Details

  • SHA256: 20f162d37cfa3414cc31f4cc0527e41fe580e03fd5a66fe600105726b35516c6
  • Pointer size: 132 Bytes
  • Size of remote file: 2.86 MB
Roots/test 3/4/2019-11-23_21-01-11_4.png ADDED

Git LFS Details

  • SHA256: 69d9522cf55fc0b9d76d4fa53ab8889a29160e45086aa6b13a9a5cba042562f8
  • Pointer size: 132 Bytes
  • Size of remote file: 2.85 MB
Roots/test 3/4/2019-11-24_00-01-11_4.png ADDED

Git LFS Details

  • SHA256: 8969bb9f45b81440a86a40f34ed339df4c383cedcfa2a7aeed21f23ec03595aa
  • Pointer size: 132 Bytes
  • Size of remote file: 2.85 MB
Roots/test 3/4/2019-11-24_04-01-11_4.png ADDED

Git LFS Details

  • SHA256: 5cef1dce2413f83e48bdf393a3681a4a67ddbdc34f2c9c618dae9a98d42d0e45
  • Pointer size: 132 Bytes
  • Size of remote file: 2.84 MB
Roots/test 3/4/2019-11-25_08-01-12_4.png ADDED

Git LFS Details

  • SHA256: 52d89c9b442a9a4582e4e5e127b76483f1f6357485b1ddb1c00d4c56d0038373
  • Pointer size: 132 Bytes
  • Size of remote file: 2.86 MB
Roots/test 3/4/2019-11-25_13-01-11_4.png ADDED

Git LFS Details

  • SHA256: 00c99b93dafba3f01624cfaef206e0f6a61c85afdbcb86c4ef5bf11d8bd7058e
  • Pointer size: 132 Bytes
  • Size of remote file: 2.86 MB
Roots/test 3/4/2019-11-26_20-01-10_4.png ADDED

Git LFS Details

  • SHA256: f67774906747397278c0e6414d21f48308c3e1a3d0492737cd1e2103e7570460
  • Pointer size: 132 Bytes
  • Size of remote file: 2.86 MB
Roots/test 3/4/2019-11-28_01-01-09_4.png ADDED

Git LFS Details

  • SHA256: 283295fa7a48e6a47825581d60d5b939e00b3c0851ae425f166534802359e43b
  • Pointer size: 132 Bytes
  • Size of remote file: 2.86 MB
Roots/test 3/4/2019-11-28_02-01-10_4.png ADDED

Git LFS Details

  • SHA256: d1b512a253f6cf5b7c7244570fbb911e60456a68cb627fbd86d89a63142647ee
  • Pointer size: 132 Bytes
  • Size of remote file: 2.85 MB
Roots/test 3/4/2019-11-28_11-01-10_4.png ADDED

Git LFS Details

  • SHA256: e0b6105774894bce003afd55785968e7221a9a266ae255095511c9f789e94055
  • Pointer size: 132 Bytes
  • Size of remote file: 2.85 MB
Roots/test 3/4/2019-11-28_15-01-10_4.png ADDED

Git LFS Details

  • SHA256: 54e1692e9758c3d19fca9bce86e0d8dc38035fb6babf26199ee27c1ca7d65b7c
  • Pointer size: 132 Bytes
  • Size of remote file: 2.86 MB
Roots/test 3/4/2019-11-29_16-01-11_4.png ADDED

Git LFS Details

  • SHA256: b9b65245cd28cf5261490824ecbe743f65eba6ee221042898ff0c756069fdabc
  • Pointer size: 132 Bytes
  • Size of remote file: 2.87 MB
Roots/test 3/4/2019-11-29_23-01-10_4.png ADDED

Git LFS Details

  • SHA256: dc50ae9fb9756a968ca968c2453faca0645ae93eac22e1f983bcf267b4ee26ce
  • Pointer size: 132 Bytes
  • Size of remote file: 2.87 MB
script.py ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import shutil
3
+ import re
4
+ from collections import defaultdict
5
+
6
+ def get_all_source_folders(scrape_dir):
7
+ """
8
+ Recursively scrapes a directory to get all folders.
9
+ Returns a dictionary mapping: folder_name -> list of full_source_paths
10
+ """
11
+ source_folders = defaultdict(list)
12
+
13
+ if not os.path.exists(scrape_dir):
14
+ print(f"Error: Scrape directory '{scrape_dir}' does not exist.")
15
+ return source_folders
16
+
17
+ # Walk through the entire directory tree
18
+ for root, dirs, files in os.walk(scrape_dir):
19
+ for d in dirs:
20
+ source_folders[d].append(os.path.join(root, d))
21
+
22
+ return source_folders
23
+
24
+ def get_subfolder_names(folder_path):
25
+ """Returns a list of subfolder names immediately inside a given directory."""
26
+ return [d for d in os.listdir(folder_path) if os.path.isdir(os.path.join(folder_path, d))]
27
+
28
+ def process_folders(scrape_dir, dest_root_path):
29
+ # 1. Scrape all folders from the source directory
30
+ source_folders = get_all_source_folders(scrape_dir)
31
+ if not source_folders:
32
+ print("No source folders found.")
33
+ return
34
+
35
+ # 2. Find matching folders in the destination root path (Second-to-last level)
36
+ dest_matches = defaultdict(list)
37
+ for root, dirs, files in os.walk(dest_root_path):
38
+ for d in dirs:
39
+ if d in source_folders:
40
+ dest_matches[d].append(os.path.join(root, d))
41
+
42
+ # Pattern to extract the date and hour: YYYY-MM-DD_HH
43
+ file_pattern = re.compile(r'^(\d{4}-\d{2}-\d{2}_\d{2})-\d{2}-\d{2}')
44
+
45
+ # 3. Process each matched robot folder
46
+ for folder_name, dest_paths in dest_matches.items():
47
+ # Check for multiple destination matches to avoid conflicts
48
+ if len(dest_paths) > 1:
49
+ print(f"NOTICE: Found {len(dest_paths)} destination matches for '{folder_name}'. Skipping.")
50
+ continue
51
+
52
+ src_paths = source_folders[folder_name]
53
+ # Check for multiple source matches
54
+ if len(src_paths) > 1:
55
+ print(f"NOTICE: Found {len(src_paths)} source matches for '{folder_name}'. Skipping.")
56
+ continue
57
+
58
+ dest_path = dest_paths[0]
59
+ src_path = src_paths[0]
60
+
61
+ # 4. Get the last level subfolders (e.g., 'camera') from the source
62
+ # We NO LONGER check if these exist in the destination first.
63
+ src_subfolders = get_subfolder_names(src_path)
64
+
65
+ # 5. Process files INSIDE the source subfolders
66
+ for subfolder in src_subfolders:
67
+ src_sub_path = os.path.join(src_path, subfolder)
68
+ dest_sub_path = os.path.join(dest_path, subfolder)
69
+
70
+ # Ensure the camera folder exists in the destination before copying
71
+ os.makedirs(dest_sub_path, exist_ok=True)
72
+
73
+ # Get all files in this specific source subfolder and sort chronologically
74
+ files = [f for f in os.listdir(src_sub_path) if os.path.isfile(os.path.join(src_sub_path, f))]
75
+ files.sort()
76
+
77
+ selected_files = {}
78
+ for file_name in files:
79
+ match = file_pattern.search(file_name)
80
+ if match:
81
+ hour_key = match.group(1)
82
+ if hour_key not in selected_files:
83
+ selected_files[hour_key] = file_name
84
+
85
+ # 6. Copy the filtered files while checking for duplicates
86
+ copied_count = 0
87
+ for file_name in selected_files.values():
88
+ src_file = os.path.join(src_sub_path, file_name)
89
+ dest_file = os.path.join(dest_sub_path, file_name)
90
+
91
+ # Skip if file was already copied
92
+ if os.path.exists(dest_file):
93
+ continue
94
+
95
+ shutil.copy2(src_file, dest_file)
96
+ copied_count += 1
97
+
98
+ if copied_count > 0:
99
+ print(f"Copied {copied_count} new files into '{folder_name}/{subfolder}'.")
100
+
101
+ print("\nProcess completed.")
102
+
103
+ if __name__ == "__main__":
104
+ # Define your paths here
105
+ SCRAPE_DIRECTORY = "../Datasets/"
106
+ DESTINATION_ROOT = "Roots"
107
+
108
+ process_folders(SCRAPE_DIRECTORY, DESTINATION_ROOT)