Skip to content

Commit f996564

Browse files
committed
predict out folder flexibility
1 parent 76f4b0b commit f996564

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

detectree2/models/predict.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
def predict_on_data(
2222
directory: str = "./",
23+
out_folder: str = "predictions",
2324
predictor=DefaultPredictor,
2425
eval=False,
2526
save: bool = True,
@@ -30,7 +31,7 @@ def predict_on_data(
3031
Predicts crowns for all png images present in a directory and outputs masks as jsons.
3132
"""
3233

33-
pred_dir = os.path.join(directory, "predictions")
34+
pred_dir = os.path.join(directory, out_folder)
3435

3536
Path(pred_dir).mkdir(parents=True, exist_ok=True)
3637

docs/source/tutorial.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ Point to a trained model, set up the configuration state and make predictions on
331331
332332
trained_model = "./230103_randresize_full.pth"
333333
cfg = setup_cfg(update_model=trained_model)
334-
predict_on_data(tiles_path, DefaultPredictor(cfg))
334+
predict_on_data(tiles_path, predictor=DefaultPredictor(cfg))
335335
336336
Once the predictions have been made on the tiles, it is necessary to project them back into geographic space.
337337

0 commit comments

Comments
 (0)