


The geometry associated with the datafame is expected to beĪ polygon but extraction is done using a windowed read based on the bounds.Īs with the ImageDataGenerator, the flow_from_dataframe method returns the Small, preprocessed images files, SDG makes use of a GeoDataFrame to identifyĮach sample area. Keras Spatial is based on the rasterio package, raster data source mayĮither local files or remote resources referenced by URL.īecause the SDG reads directly from larger raster data sources rather than Reprojection and resampling is handled automatically as needed. Than pixels and easily integrate data from different coordinates systems. The SDG allows user to work in spatial coorindates rather Keras Spatial provides a SpatialDataGenerator (SDG) modeled on the Keras flow_from_dataframe ( geodataframe, 128, 128, batch_size = 32 ) model ( generator. regular_grid ( 200, 200 ) generator = sdg. Create the generator producing arrays with shape įrom keras_spatial.datagen import SpatialDataGenerator sdg = SpatialDataGenerator ( source = '/path/to/file.tif' ) geodataframe = sdg.Create a geodataframe with 200x200 (in projection units) samples covering the spatial extent of the raster.Create a SpatialDataGen and set the source raster.
Keras data generator example install#
Or directly from GitHub $ pip install git+ -process-dependency-links To install the package from PyPi repository you can execute the following command: pip install keras-spatial

Keras Spatial provides a data generator that reads samples directlyįrom a raster data source and eliminates the need to create small, The preprocessing of spatial data for deep learning applications. Keras Spatial includes data generators and tools designed to simplify
