charge-benchmark commited on
Commit
55a0155
·
verified ·
1 Parent(s): 2122249

Upload 5 files

Browse files
download_all.sh ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ if [ "$1" = "" ]
3
+ then
4
+ echo "Usage: $0 <output-dir>"
5
+ exit
6
+ fi
7
+ python downloader.py -o $1 -s 010_0050 020_0020 040_0040 050_0130 050_0160 060_0100 060_0130 070_0123 -m rgb depth mask segmentation normal flow_fw flow_bw -t Dense Sparse Mono
download_rgb_dense.sh ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ if [ "$1" = "" ]
3
+ then
4
+ echo "Usage: $0 <output-dir>"
5
+ exit
6
+ fi
7
+ python downloader.py -o $1 -s 010_0050 020_0020 040_0040 050_0130 050_0160 060_0100 060_0130 070_0123 -m rgb -t Dense
download_rgb_mono.sh ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ if [ "$1" = "" ]
3
+ then
4
+ echo "Usage: $0 <output-dir>"
5
+ exit
6
+ fi
7
+ python downloader.py -o $1 -s 010_0050 020_0020 040_0040 050_0130 050_0160 060_0100 060_0130 070_0123 -m rgb -t Mono
download_rgb_sparse.sh ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ if [ "$1" = "" ]
3
+ then
4
+ echo "Usage: $0 <output-dir>"
5
+ exit
6
+ fi
7
+ python downloader.py -o $1 -s 010_0050 020_0020 040_0040 050_0130 050_0160 060_0100 060_0130 070_0123 -m rgb -t Sparse
downloader.py ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from huggingface_hub import snapshot_download
2
+ import argparse
3
+
4
+ parser = argparse.ArgumentParser()
5
+ parser.add_argument(
6
+ "--output-dir", "-o", required=True, help="Output directory for the dataset."
7
+ )
8
+ parser.add_argument(
9
+ "--scenes", "-s", required=True, nargs="+", help="List of scenes to download.",
10
+ choices=["010_0050", "020_0020", "040_0040", "050_0130", "050_0160", "060_0100", "060_0130", "070_0123"]
11
+ )
12
+ parser.add_argument(
13
+ "--modalities", "-m", required=True, nargs="*", help="List of scenes to download.",
14
+ choices=["rgb", "depth", "mask", "segmentation", "normal", "flow_fw", "flow_bw"]
15
+ )
16
+ parser.add_argument(
17
+ "--tasks", "-t", required=True, nargs="+", help="Tasks to download.",
18
+ choices=["Dense", "Sparse", "Mono"]
19
+ )
20
+
21
+ def main(args):
22
+ # Collect scenes from multiple repos
23
+ repo_type = "dataset"
24
+
25
+ # Set modalities patterns
26
+ all_modalities = ["rgb", "depth", "mask", "segmentation", "normal", "flow_fw", "flow_bw"]
27
+ modalities_exclude = set(all_modalities) - set(args.modalities)
28
+ exclude_patterns = []
29
+ for mod in modalities_exclude:
30
+ if mod == "rgb":
31
+ exclude_patterns.append("*frame_????.png")
32
+ elif mod == "depth":
33
+ exclude_patterns.append("*_depth.npy")
34
+ elif mod == "mask":
35
+ exclude_patterns.append("*_dyn_mask.png")
36
+ elif mod == "flow_fw":
37
+ exclude_patterns.append("*_flow_fw.npy")
38
+ elif mod == "flow_bw":
39
+ exclude_patterns.append("*_flow_bw.npy")
40
+ elif mod == "segmentation":
41
+ exclude_patterns.append("*_segmentation.png")
42
+ elif mod == "normal":
43
+ exclude_patterns.append("*_normal.png")
44
+
45
+ # Set task patterns
46
+ allow_patterns = []
47
+ for task in args.tasks:
48
+ allow_patterns.append(f"*/{task}/*")
49
+ if "segmentation" not in modalities_exclude:
50
+ allow_patterns.append("*segmentation.json")
51
+
52
+ # Download from respective repos
53
+ for scene in args.scenes:
54
+ if scene == "050_0130":
55
+ repo_id = "charge-benchmark/Charge-050_0130"
56
+ snapshot_download(
57
+ repo_id=repo_id,
58
+ repo_type=repo_type,
59
+ allow_patterns=allow_patterns,
60
+ ignore_patterns=exclude_patterns,
61
+ local_dir=args.output_dir
62
+ )
63
+ else:
64
+ print(f"Scene {scene} not available yet.")
65
+
66
+
67
+ if __name__ == "__main__":
68
+ args = parser.parse_args()
69
+ main(args)