-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathrun.py
More file actions
executable file
·37 lines (31 loc) · 1.15 KB
/
run.py
File metadata and controls
executable file
·37 lines (31 loc) · 1.15 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
import argparse
import random
import numpy as np
import torch
import os
import src.utils
from src.system import EC_SLAM
def setup_seed(seed):
# print("set seed ",seed)
os.environ['PYTHONHASHSEED'] = str(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
np.random.seed(seed)
random.seed(seed)
torch.backends.cudnn.benchmark = False
torch.backends.cudnn.deterministic = True
def main():
# setup_seed(43)
parser = argparse.ArgumentParser(description='Arguments for running the EC_SLAM.')
parser.add_argument('config', type=str, help='Path to config file.')
parser.add_argument('--input_folder', type=str,
help='input folder, this have higher priority, can overwrite the one in config file')
parser.add_argument('--output', type=str,
help='output folder, this have higher priority, can overwrite the one in config file')
args = parser.parse_args()
cfg = src.utils.load_config(args.config, 'configs/EC_SLAM.yaml') # dataset&&slam yaml concat
slam = EC_SLAM(cfg, args)
slam.run()
if __name__ == '__main__':
main()