Currently our predict functions return two possible outputs:
A numpy array that represents an image of the RGB data with the predictions drawn on top
A Pandas DataFrame with bounding box coordinates
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:
"a tuple of image crops and predictions"
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.
Currently our predict functions return two possible outputs:
The difference is the value of the optional
return_plot
argument, withTrue
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 likevisualize_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 bypredictions_*
.One added complexity is that
predict_tile()
can also return a third data type if the optional argumentmosaic
is set toFalse
: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.