From 71e89ebdfa489e8c3d28ec668d9dad7da2ca5988 Mon Sep 17 00:00:00 2001 From: Paul-Edouard Sarlin Date: Tue, 22 Aug 2023 17:00:32 +0200 Subject: [PATCH] Modify Mapillary processing config from CLI --- maploc/data/mapillary/prepare.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/maploc/data/mapillary/prepare.py b/maploc/data/mapillary/prepare.py index e6f79cb..59c4485 100644 --- a/maploc/data/mapillary/prepare.py +++ b/maploc/data/mapillary/prepare.py @@ -132,7 +132,7 @@ } -cfg = OmegaConf.create( +default_cfg = OmegaConf.create( { "max_image_size": 512, "do_legacy_pano_offset": True, @@ -277,6 +277,7 @@ def process_location( data_dir: Path, split_path: Path, token: str, + cfg: DictConfig, generate_tiles: bool = False, ): params = location_to_params[location] @@ -393,10 +394,12 @@ def process_location( "--data_dir", type=Path, default=MapillaryDataModule.default_cfg["data_dir"] ) parser.add_argument("--generate_tiles", action="store_true") + parser.add_argument("dotlist", nargs="*") args = parser.parse_args() args.data_dir.mkdir(exist_ok=True, parents=True) shutil.copy(Path(__file__).parent / args.split_filename, args.data_dir) + cfg_ = OmegaConf.merge(default_cfg, OmegaConf.from_cli(args.dotlist)) for location in args.locations: logger.info("Starting processing for location %s.", location) @@ -405,5 +408,6 @@ def process_location( args.data_dir, args.data_dir / args.split_filename, args.token, + cfg_, args.generate_tiles, )