Skip to content

Commit

Permalink
add default out_path value
Browse files Browse the repository at this point in the history
  • Loading branch information
mpelchat04 committed Sep 9, 2024
1 parent 7e9d082 commit 94f2dea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion inference_segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ def main(params:Union[DictConfig, Dict]):
"classes_dict": classes_dict}
with rasterio.open(mask_path, 'r+') as raster:
raster.update_tags(**meta_data_dict)
output_path = get_key_def('output_path', params['inference'], expected_type=str, to_path=True)
output_path = get_key_def('output_path', params['inference'], expected_type=str, to_path=True,
default=str(working_folder / f"{aoi.aoi_id}_raw.tif"))
os.rename(mask_path, output_path)
logging.info(f"finished inferring image: {aoi.aoi_id} ")
1 change: 1 addition & 0 deletions tests/CI/test_gh_actions_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def test_ci(self) -> None:
f"inference=default_{dataset_type}",
f"training.num_gpus=0",
f"loss={dataset_type}/lovasz",
"inference.output_path=./tst.tif",
"hydra.job.num=0"],
return_hydra_config=True)
hconf = HydraConfig()
Expand Down

0 comments on commit 94f2dea

Please sign in to comment.