You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 $[x, y]$ input geographic coordinates, one could trigger an error exception by indexing $[x, y]$ on 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 $[x,y]$ input geographic coordinates and the horizontal & vertical borders of a raster to query the $|\frac{size}{2}|$ values of the patch (in the pixel-coordinate system).
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 nan values. 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
The text was updated successfully, but these errors were encountered:
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 thePatchExtractor
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.Let us consider
patch_extractor = PatchExtractor("./my_rasters", size=256)
wheresize
is the patch size.Since a patch is generated from its center pixel deduced from the$[x, y]$ input geographic coordinates, one could trigger an error exception by indexing $[x, y]$ on
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$[x,y]$ input geographic coordinates and the horizontal & vertical borders of a raster to query the $|\frac{size}{2}|$ values of the patch (in the pixel-coordinate system).
Otherwise, out-of-bounds values (relatively to the raster) will be queried to construct a patch.
It is unclear about which solution is best suited for every user, but there are several possibilitis :
nan
values. Downside : no distinction between ocean and out-of-bounds pixels.The text was updated successfully, but these errors were encountered: