Skip to content

Commit

Permalink
Modify Mapillary processing config from CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
sarlinpe committed Aug 22, 2023
1 parent 442a6cc commit 71e89eb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion maploc/data/mapillary/prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
}


cfg = OmegaConf.create(
default_cfg = OmegaConf.create(
{
"max_image_size": 512,
"do_legacy_pano_offset": True,
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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)
Expand All @@ -405,5 +408,6 @@ def process_location(
args.data_dir,
args.data_dir / args.split_filename,
args.token,
cfg_,
args.generate_tiles,
)

0 comments on commit 71e89eb

Please sign in to comment.