added project argument to predict_tile for geo-coordinates#1250
added project argument to predict_tile for geo-coordinates#1250musaqlain wants to merge 1 commit into
project argument to predict_tile for geo-coordinates#1250Conversation
ethanwhite
left a comment
There was a problem hiding this comment.
Sorry this got lost in the queue @musaqlain. Everything looks really good. I've requested a couple of small changes to the docstring.
My one bigger question is what happens if someone sets project=True and passes a path to a non-georeferenced file. It would be good to make sure that we fail informatively in this case, which might happen automatically or might require a new check either in the new if project: block or in image_to_geo_coordinates
Thanks for pointing this out! I have added a check in the |
2461cad to
3ed720f
Compare
3ed720f to
be8794b
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1250 +/- ##
==========================================
- Coverage 86.96% 86.40% -0.56%
==========================================
Files 26 26
Lines 3712 3744 +32
==========================================
+ Hits 3228 3235 +7
- Misses 484 509 +25
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ethanwhite
left a comment
There was a problem hiding this comment.
Looks really good. One additional docstring change suggestion and a question about whether there is some duplicate code being added
| pd.DataFrame or tuple: Predictions dataframe or (predictions, crops) tuple | ||
| pd.DataFrame, geopandas.GeoDataFrame, or tuple: Predictions dataframe, geopandas.GeoDataFrame, or (predictions, crops) tuple. |
There was a problem hiding this comment.
Probably a little more cleanly: "pd.DataFrame, geopandas.GeoDataFrame, or tuple: Predictions dataframe with or without geometry or (predictions, crops) tuple.
| if root_dir is None: | ||
| root_dir = os.path.dirname(paths[0]) |
There was a problem hiding this comment.
Does the code starting on Line 723 already cover this?
addresses Issue #608. Previously,
predict_tilereturned pixel coordinates even if the input was a georeferenced raster. This PR adds an optionalproject=Falseargument to allow users to request map coordinates directly.predict_tileinsrc/deepforest/main.pyto acceptproject(bool).project=True, the results are converted to a GeoDataFrame usingutilities.image_to_geo_coordinates.test_predict_tile_projectedtotests/test_main.pyto verify that settingproject=Truereturns a GeoDataFrame with valid CRS and map coordinates (UTM).Closes #608
AI-Assisted Development
I utilized AI for sanity checking code logic and conducting an assisted review to identify potential missing resets and schema constraints.