-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathrun.py
More file actions
66 lines (59 loc) · 1.83 KB
/
run.py
File metadata and controls
66 lines (59 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import argparse
from fastmap.config import Config, load_config
from fastmap.engine import engine
def run(args):
if args.config is None:
config = Config()
else:
config: Config = load_config(args.config)
engine(
cfg=config,
device=args.device,
database_path=args.database,
output_dir=args.output_dir,
pinhole=args.pinhole,
headless=args.headless,
calibrated=args.calibrated,
image_dir=args.image_dir,
gt_model_path=args.gt_model,
)
if __name__ == "__main__":
# parse command line arguments
parser = argparse.ArgumentParser()
parser.add_argument(
"--database", type=str, required=True, help="Path to input database."
)
parser.add_argument(
"--config",
type=str,
default=None,
help="Path to YAML config file. See fastmap/config.py for all the options.",
)
parser.add_argument(
"--image_dir",
type=str,
default=None,
help="Directory containing images.",
)
parser.add_argument(
"--output_dir", type=str, default=None, help="Path to output directory."
)
parser.add_argument("--device", type=str, default="cuda:0", help="Device to use.")
parser.add_argument(
"--pinhole", action="store_true", help="Use pinhole camera model."
)
parser.add_argument("--headless", action="store_true", help="Run in headless mode.")
parser.add_argument(
"--calibrated",
action="store_true",
help="Use the focal length and principal point from the database.",
)
parser.add_argument(
"--gt_model",
type=str,
default=None,
help="Path to ground truth model (e.g. otuput of colmap) for debugging purposes.",
)
args = parser.parse_args()
# run the engine
run(args)