diff --git a/detectree2/models/predict.py b/detectree2/models/predict.py index 4c774fb9..648e002a 100644 --- a/detectree2/models/predict.py +++ b/detectree2/models/predict.py @@ -20,6 +20,7 @@ def predict_on_data( directory: str = "./", + out_folder: str = "predictions", predictor=DefaultPredictor, eval=False, save: bool = True, @@ -30,7 +31,7 @@ def predict_on_data( Predicts crowns for all png images present in a directory and outputs masks as jsons. """ - pred_dir = os.path.join(directory, "predictions") + pred_dir = os.path.join(directory, out_folder) Path(pred_dir).mkdir(parents=True, exist_ok=True) diff --git a/docs/source/tutorial.rst b/docs/source/tutorial.rst index c7610818..c74dc6b2 100644 --- a/docs/source/tutorial.rst +++ b/docs/source/tutorial.rst @@ -331,7 +331,7 @@ Point to a trained model, set up the configuration state and make predictions on trained_model = "./230103_randresize_full.pth" cfg = setup_cfg(update_model=trained_model) - predict_on_data(tiles_path, DefaultPredictor(cfg)) + predict_on_data(tiles_path, predictor=DefaultPredictor(cfg)) Once the predictions have been made on the tiles, it is necessary to project them back into geographic space.