MCPcopy Create free account
hub / github.com/Ropedia/SpatialBench / parse_args

Function parse_args

benchmark/models/r3/demo.py:86–184  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

84
85
86def parse_args() -> argparse.Namespace:
87 parser = argparse.ArgumentParser(
88 description=__doc__,
89 formatter_class=argparse.RawDescriptionHelpFormatter,
90 )
91 parser.add_argument("--seq_path", default="examples/indoor", help="Image directory or video path.")
92 parser.add_argument(
93 "--output_dir",
94 default="",
95 help="Where to save run outputs. Defaults to scratch/demo/<scene>_<backend>_<mode>_<timestamp>.",
96 )
97 parser.add_argument("--config_name", default="r3-large", help="Config stem or YAML path.")
98 parser.add_argument(
99 "--ckpt",
100 default=None,
101 help=(
102 "Checkpoint path. Defaults to ckpt/r3.safetensors, or "
103 "ckpt/r3_long.safetensors for --mode long/strided. "
104 "Pass an empty string to auto-resolve from --config_name."
105 ),
106 )
107 parser.add_argument("--device", default="cuda", help="Inference device.")
108 parser.add_argument("--size", type=int, default=504, help="Image resize target.")
109 parser.add_argument("--max_frames", type=int, default=0, help="Limit frames for the demo; 0 means all.")
110 parser.add_argument("--frame_stride", type=int, default=1, help="Use every N-th input frame.")
111 parser.add_argument("--kv_backend", choices=["dense", "paged"], default="dense", help="Online KV backend.")
112 parser.add_argument(
113 "--kv_cache_mode",
114 choices=["all", "dynamic"],
115 default="dynamic",
116 help="Online KV retention mode.",
117 )
118 parser.add_argument("--recent_frames", type=int, default=0, help="Recent frames retained by dynamic mode.")
119 parser.add_argument(
120 "--bootstrap_full_attention_frames",
121 type=int,
122 default=0,
123 help="Run a full-attention bootstrap on the first N frames before online inference.",
124 )
125 parser.add_argument(
126 "--rel_pose_method",
127 choices=["greedy", "pgo"],
128 default="greedy",
129 help="Relative-pose reconstruction method.",
130 )
131 parser.add_argument(
132 "--mode",
133 default="test",
134 metavar="{test,local,long,strided}",
135 help=(
136 "Preset bundle. "
137 "'test' = quick test run, all kv, no fallback, no metric. "
138 "'local' = small-coverage scenes, dynamic kv, no fallback, no metric. "
139 "'long' = long trajectories / large outdoor scenes, dynamic kv + fallback + metric. "
140 "'strided' = temporally strided video sequences, all kv + fallback + metric. "
141 "Legacy aliases: 'short' -> 'local', 'sampled'/'sparse' -> 'strided'."
142 ),
143 )

Callers 1

mainFunction · 0.70

Calls 2

getMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected