weiji14 / zen3geo

The 🌏 data science library you've been waiting for~
http://zen3geo.rtfd.io/en/latest/walkthrough.html
GNU Lesser General Public License v3.0
77 stars 3 forks source link

:sparkles: XbatcherSlicerIterDataPipe for slicing xarray.DataArray #22

Closed weiji14 closed 2 years ago

weiji14 commented 2 years ago

An iterable-style DataPipe for creating chips from xarray.DataArray objects! The windowed slicing is done using xbatcher.

Note that xbatcher is only used here to create slices of data (or chips/tiles), the actual creation of mini-batches (lumping together several slices/chips/tiles of images) will be handled by https://pytorch.org/data/0.4.0/generated/torchdata.datapipes.iter.Batcher.html

Preview at https://zen3geo--22.org.readthedocs.build/en/19/api.html#module-zen3geo.datapipes.xbatcher

Note that since xbatcher is made an optional dependency, users would need to do pip install zen3geo[raster] to install the extra 'raster' packages that includes xbatcher (and possibly more in the future).

TODO: