weecology / DeepForest

Python Package for Airborne RGB machine learning
https://deepforest.readthedocs.io/
MIT License
512 stars 172 forks source link

Consider decoupling plotting from predict_* functions #761

Closed ethanwhite closed 1 month ago

ethanwhite commented 2 months ago

Currently our predict functions return two possible outputs:

The difference is the value of the optional return_plot argument, with True returning the numpy array.

This can be confusing (see #760). I'm wondering if the more intuitive design in the long run is to have predict_* only return data frames (including maybe spatial data frames see #608) and then have a function (or suite of functions) called something like visualize_predictions() to make graphs. This seems like a relatively straightforward split with the new function(s) taking either a raster object or path and a data frame returned by predictions_*.

One added complexity is that predict_tile() can also return a third data type if the optional argument mosaic is set to False:

This one doesn't come up at the moment because it isn't described in the docs. I'm not super clear on the use case for this last one, so clarifying that might make the design clearer.

bw4sz commented 2 months ago

I agree. As part of this, I want to hide the function convert_to_sv from users