Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider decoupling plotting from predict_* functions #761

Closed
ethanwhite opened this issue Aug 28, 2024 · 1 comment
Closed

Consider decoupling plotting from predict_* functions #761

ethanwhite opened this issue Aug 28, 2024 · 1 comment
Labels
API This tag is used for small improvements to the readability and usability of the python API.

Comments

@ethanwhite
Copy link
Member

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.

@ethanwhite ethanwhite added the API This tag is used for small improvements to the readability and usability of the python API. label Aug 28, 2024
@bw4sz
Copy link
Collaborator

bw4sz commented Aug 30, 2024

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

  • Better doc and example of visualizing the output of predict_* functions.
  • Streamline and reduce the visualizing module, too much duplications and not clear the user workflow.

bw4sz added a commit that referenced this issue Sep 10, 2024
…emove plotting from predict functions, closes #761 and update docs
bw4sz added a commit that referenced this issue Sep 19, 2024
…emove plotting from predict functions, closes #761 and update docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API This tag is used for small improvements to the readability and usability of the python API.
Projects
None yet
Development

No branches or pull requests

2 participants