-
Notifications
You must be signed in to change notification settings - Fork 7
Description
- Context
Multi-modal datasets like GeoLifeCLEF's comprise numerous bioclimatic and pedologic variables that can be aggregated to construct rasters, scaling up to countries or continents.
These rasters are then divided into smaller patches that are being fed into the deep learning module by calling the private method environmental_raster.Raster._extract_patch through the PatchExtractor class constructor, by indexing an instance of said class.
During the process, the python module rasterio is used to process input data (Tiff, gTiff...) into a custom, useable dataset object.
- Problem
Let us consider patch_extractor = PatchExtractor("./my_rasters", size=256) where size is the patch size.
Since a patch is generated from its center pixel deduced from the patch_extractor if these coordinates were not far enough from the edge of the raster.
Indeed, for a patch to be correctly built and returned, there needs to enough space betwen the
Otherwise, out-of-bounds values (relatively to the raster) will be queried to construct a patch.
- Solution
It is unclear about which solution is best suited for every user, but there are several possibilitis :
- Force the user to index valid input coordinates so that the patch window fits in the raster.
- Fill with
nanvalues. Downside : no distinction between ocean and out-of-bounds pixels. - Apply a padding around the raster data (either mirror or repeat pattern)
- Leave the choice to the user