open-forest-observatory / geograypher

Multiview Semantic Reasoning with Geospatial Data
BSD 3-Clause "New" or "Revised" License
10 stars 4 forks source link

Replace rastervision with on-disk chip aggregation using rasterio #37

Closed russelldj closed 7 months ago

russelldj commented 7 months ago

We were having numerous issues with the aggregation approach for chipped predictions using rastervision including improper handling of ROIs and frequent OOM errors. I replaced this with a version using rasterio directly. This uses windowed read/writes so all bookkeeping is done on disk. This does require substantial temporary disk storage, but is generally more robust.

I still need to do a bit of cleanup and documentation but this is now functional.

On future improvement that I don't think needs to be addressed on this PR is to allow tiled predictions that are geospatially referenced, rather than requiring that they are referenced by pixel coordinates in the original raster. This should be fairly straightforward, but would require us to support resampling if the predictions are provided in a different CRS than the original raster.

russelldj commented 7 months ago

I fixed a flipped coordinate bug in the windowing and now the predictions look much better updated_ortho_seg