Skip to content

Commit

Permalink
predict out folder flexibility
Browse files Browse the repository at this point in the history
  • Loading branch information
PatBall1 committed Aug 1, 2023
1 parent 76f4b0b commit f996564
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion detectree2/models/predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

def predict_on_data(
directory: str = "./",
out_folder: str = "predictions",
predictor=DefaultPredictor,
eval=False,
save: bool = True,
Expand All @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion docs/source/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit f996564

Please sign in to comment.