Doodleverse / doodleverse_utils

A set of common Doodleverse tools and utilities
MIT License
4 stars 3 forks source link

Recommended change for constructing output filename in `do_seg()` #25

Closed CameronBodine closed 1 year ago

CameronBodine commented 1 year ago

I recommend a change to how the ouput filename is constructed in the do_seg() workflow. The current method for creating the output filename is as follows:

https://github.com/Doodleverse/doodleverse_utils/blob/83128ee3e7a8dd901415c6f00145f31b8c44bb02/doodleverse_utils/prediction_imports.py#L128-L154

If you pass an alternate output directory to do_seg stored in the sample_direc variable, the outputs are still saved to the directory where the input files are stored. I would like to be able to pass an alternate directory to save model predictions. Therefore, I recommend changing:

https://github.com/Doodleverse/doodleverse_utils/blob/83128ee3e7a8dd901415c6f00145f31b8c44bb02/doodleverse_utils/prediction_imports.py#L151-L154

to:

segfile = os.path.basename(segfile)
segfile = os.path.join(out_dir_path, segfile)

Just a recommendation though!!

dbuscombe-usgs commented 1 year ago

This is a good idea, and thanks for suggesting it, but I decline to make this change because it will break downstream applications. User can move folders if they need to.