SLURP Configuration
SLURP can be configured with JSON files that allows you to set various parameters.
The main configuration file is given to the SLURP’s API or CLI through the main_config argument.
Tip
Some arguments defined by the JSON file can be overwritten by command line arguments or by API’s arguments. For more information, please refer to API’s documentation or refer to the help of your CLI command (cli_command_name –help).
Below is an example of a configuration file:
Field Group |
Field Name |
Expected Type |
Description |
Status |
|---|---|---|---|---|
input |
Input data for the configuration |
Mandatory |
||
file_vhr |
Str |
Input 4 bands VHR (Very High Resolution) image |
Mandatory |
|
sensor_mode |
Bool |
True if input image is in its raw (sensor) geometry, False if input image is georeferenced (orthorectification) |
Mandatory |
|
aux_layers |
Auxiliary layers used in processing |
Mandatory |
||
valid_stack |
Str (Default None) |
Path to store the valid stack file |
Optional |
|
file_ndvi |
Str |
Path to the NDVI layer |
Mandatory |
|
file_ndwi |
Str |
Path to the NDWI layer |
Mandatory |
|
extracted_pekel |
Str |
Path to the extracted Pekel data |
Mandatory |
|
extracted_hand |
Str |
Path to the extracted HAND data |
Mandatory |
|
extracted_wsf |
Str |
Path to the extracted World Settlement Footprint |
Mandatory |
|
extracted_wbm |
Str (Default None) |
Path to the extracted Water Body Mask |
Optional |
|
file_texture |
Str |
Path to store the texture file |
Mandatory |
|
mnh |
Str (Default None) |
Path to the Mean Height of Nearest Neighbors (MN) layer |
Optional |
|
file_cloud_gml |
Str (Default None) |
GML file containing cloud masks (optional) |
Optional |
|
masks |
Masks for different types of land cover and features |
Mandatory |
||
watermask |
Str |
For watermask computation: Output classification filename. For stackmask: Water mask to stack. Otherwise, if given, output mask will exclude water areas |
Mandatory |
|
urbanmask |
Str |
For urbanmask computation: Output classification filename. For stackmask: Vegetation mask to stack. |
Mandatory |
|
vegetationmask |
Str |
For vegetationmask computation : Output classification filename. For stackmask: Vegetation mask to stack. Otherwise, if given, output mask will exclude vegetation areas |
Mandatory |
|
shadowmask |
Str |
For shadowmask computation : Output classification filename. For stackmask: Shadow mask to stack. Otherwise, if given, big shadow areas will be marked as background |
Mandatory |
|
stackmask |
Str |
Output classification filename |
Mandatory |
|
resources |
Resources configuration for parallel processing |
Mandatory |
||
debug |
Bool (Default False) |
Flag for debugging mode (default : False) |
Optional |
|
n_workers |
Int |
Number of CPU |
Mandatory |
|
tile_max_size |
Int |
Maximum size of tiles to process |
Mandatory |
|
multiproc_context |
Str (Default ‘spawn’) |
Multiprocessing strategy: ‘fork’ or ‘spawn’ for EOScale |
Optional |
|
n_jobs |
Int |
Nb of parallel jobs for Random Forest (1 is recommanded : use n_workers to optimize parallel computing) |
Mandatory |
|
save_mode |
Str |
Save all files (debug) or only output mask (none) |
Mandatory |
|
prepare |
Preparation settings for preprocessing |
Mandatory |
||
red |
Int |
Red band index |
Mandatory |
|
green |
Int |
Green band index |
Mandatory |
|
nir |
Int |
NIR band index |
Mandatory |
|
cloud_mask |
Str (Default None) |
Path to the input cloud mask |
Optional |
|
pekel_method |
Str |
Method for Pekel recovery : ‘all’ for global file and ‘month’ for monthly recovery |
Mandatory |
|
pekel |
Str |
Path of the global Pekel (Global Surface Water) file |
Mandatory |
|
pekel_monthly_occurrence |
Str (Default None) |
Path of the root of monthly occurrence Pekel files |
Optional |
|
pekel_obs |
Str (Default None) |
Month of the desired Pekel (Global Surface Water) file (pekel_method = month) |
Optional |
|
hand |
Str |
Path of the global Height Above Nearest Drainage (HAND) file |
Mandatory |
|
wsf |
Str |
Path of the global World Settlement Footprint (WSF) file |
Mandatory |
|
wbm |
Str |
Path of the global Water Body Mask (WBM) file |
Mandatory |
|
texture_rad |
Int |
Radius for texture (std convolution) computation |
Mandatory |
|
dtm |
Str (Default None) |
Digital Terrain Model, used only in sensor mode |
Optional |
|
geoid_file |
Str |
Geoid file, used only in sensor mode |
Mandatory |
|
analyse_glcm |
Bool |
Use a global land cover map to calculate the better number of vegetation cluster to use for mask computation |
Mandatory |
|
land_cover_map |
Str |
Input land cover map, only used if ‘analyse_glcm’ is True |
Mandatory |
|
cropped_land_cover_map |
Bool |
If the land_cover_map image is cropped to the input VHR file or not |
Mandatory |
|
effective_used_config |
Str |
Path to the effective configuration used |
Mandatory |
|
post_process |
Settings for post-processing |
Mandatory |
||
binary_opening |
Int |
Size of disk structuring element |
Mandatory |
|
binary_closing |
Int |
Size of disk structuring element |
Mandatory |
|
binary_dilation |
Int |
Size of disk structuring element |
Mandatory |
|
remove_small_objects |
Int |
The maximum area, in pixels, of a contiguous object that will be removed |
Mandatory |
|
remove_small_holes |
Int |
The maximum area, in pixels, of a contiguous hole that will be filled |
Mandatory |
|
area_closing |
Str (Default None) |
Area closing removes all dark structures |
Optional |
|
shadows |
Shadow detection settings |
Mandatory |
||
th_rgb |
Float |
Relative shadow threshold for RGB bands |
Mandatory |
|
th_nir |
Float |
Relative shadow threshold for NIR band |
Mandatory |
|
percentile |
Int |
Percentile value to cut histogram and estimate shadow threshold |
Mandatory |
|
absolute_threshold |
Bool |
Compute shadow mask with a unique absolute threshold |
Mandatory |
|
urban |
Urban classification settings |
Mandatory |
||
files_layers |
List[Str] (Default None) |
Add layers as additional features used by learning algorithm |
Optional |
|
vegmask_min_value |
Int (Default None) |
Vegetation min value for vegetated areas : all pixels with lower value will be predicted |
Optional |
|
veg_binary_dilation |
Int |
Size of disk structuring element (dilate non vegetated areas) |
Mandatory |
|
value_classif |
Int |
Input ground truth class to consider in the input ground truth |
Mandatory |
|
gt_binary_erosion |
Int |
Size of disk structuring element (erode GT before picking-up samples) |
Mandatory |
|
nb_samples_other |
Int |
Number of samples in other for learning |
Mandatory |
|
nb_samples_urban |
Int |
Number of samples in buildings for learning |
Mandatory |
|
max_depth |
Int |
Maximum depth of the decision tree |
Mandatory |
|
nb_estimators |
Int |
Number of trees in Random Forest |
Mandatory |
|
vegetation |
Vegetation classification settings |
Mandatory |
||
texture_mode |
Str |
Labelize vegetation with (yes) or without (no) distinction low/high, or get all vegetation clusters without distinction low/high (debug) |
Mandatory |
|
filter_texture |
Int |
Percentile for texture (between 1 and 99) |
Mandatory |
|
slic_seg_size |
Int |
Approximative segment size |
Mandatory |
|
slic_compactness |
Float |
Balance between color and space proximity (see skimage.slic documentation) |
Mandatory |
|
nb_clusters_veg |
Int |
Nb of clusters considered as vegetation (1-NB_CLUSTERS) |
Mandatory |
|
min_ndvi_veg |
Float (Default None) |
Minimal mean NDVI value to consider a cluster as vegetation (overload nb clusters choice) |
Optional |
|
max_ndvi_noveg |
Float (Default None) |
Maximal mean NDVI value to consider a cluster as non-vegetation (overload nb clusters choice) |
Optional |
|
non_veg_clusters |
List[Int] (Default None) |
Labelize each ‘non vegetation cluster’ as 0, 1, 2 (..) instead of single label (0) |
Optional |
|
nb_clusters_low_veg |
Int |
Nb of clusters considered as low vegetation (1-NB_CLUSTERS) |
Mandatory |
|
max_texture_th |
Float (Default None) |
Maximal texture value to consider a cluster as low vegetation (overload nb clusters choice) |
Optional |
|
water |
Water detection settings |
Mandatory |
||
files_layers |
List[Str] |
Add layers as additional features used by learning algorithm |
Mandatory |
|
thresh_pekel |
Int |
Threshold for Pekel water occurrence detection |
Mandatory |
|
thresh_hand |
Int |
Hand Threshold int >= 0 |
Mandatory |
|
hand_strict |
Bool |
Use not(pekelxx) for other (no water) samples |
Mandatory |
|
strict_thresh |
Int |
Pekel Threshold float if hand_strict |
Mandatory |
|
simple_ndwi_threshold |
Bool |
Compute water mask as a simple NDWI threshold - useful in arid places where no water is known by Peckel |
Mandatory |
|
ndwi_threshold |
Float |
Threshold used when Pekel is empty in the area |
Mandatory |
|
samples_method |
Str |
Select method for choosing learning samples (‘grid’ or ‘random’ or ‘smart’) |
Mandatory |
|
nb_samples_water |
Int |
Number of samples in water for learning |
Mandatory |
|
nb_samples_other |
Int |
Number of samples in other for learning |
Mandatory |
|
nb_samples_auto |
Bool |
Auto select number of samples for water and other |
Mandatory |
|
auto_pct |
Float |
Percentage of samples points, to use with -nb_samples_auto |
Mandatory |
|
smart_area_pct |
Int |
For smart method, importance of area for selecting number of samples in each water surface |
Mandatory |
|
smart_minimum |
Int |
For smart method, minimum number of samples in each water surface. |
Mandatory |
|
grid_spacing |
Int |
For grid method, select samples on a regular grid (40 pixels seems to be a good value) |
Mandatory |
|
max_depth |
Int |
Max depth of trees |
Mandatory |
|
nb_estimators |
Int |
Number of estimators for the water classifier |
Mandatory |
|
no_pekel_filter |
Bool |
Deactivate postprocess with pekel which only keeps surfaces already known by pekel |
Mandatory |
|
hand_filter |
Bool |
Postprocess with Hand (set to 0 when hand > thresh), incompatible with hand_strict |
Mandatory |
|
value_classif |
Int |
Output classification value (default is 1) |
Mandatory |
|
stack |
Stack processing settings |
Mandatory |
||
building_threshold |
Int |
Threshold for building detection in the stack |
Mandatory |
|
building_erosion |
Int |
Supposed buildings will be eroded by this size in the marker step |
Mandatory |
|
bonus_gt |
Int |
Bonus for pixels covered by GT, in the watershed regularization step (ex : +30 to improve discrimination between building and background) |
Mandatory |
|
malus_shadow |
Int |
Value of the malus for pixels in shadow, in the watershed regularization step |
Mandatory |
|
value_classif_low_veg |
Int (Default 1) |
Output classification value for low vegetation |
Optional |
|
value_classif_high_veg |
Int (Default 2) |
Output classification value for high vegetation |
Optional |
|
value_classif_water |
Int (Default 3) |
Output classification value for water |
Optional |
|
value_classif_buildings |
Int (Default 4) |
Output classification value for buildings |
Optional |
|
value_classif_bare_ground |
Int (Default 6) |
Output classification value for bare ground |
Optional |
|
value_classif_sea |
Int (Default 7) |
Output classification value for sea |
Optional |
|
value_classif_lake |
Int (Default 8) |
Output classification value for sea |
Optional |
|
value_classif_river |
Int (Default 9) |
Output classification value for sea |
Optional |
|
value_classif_false_positive_buildings |
Int |
Output classification value for buildings false positive |
Mandatory |
|
value_classif_background |
Int |
Output classification value for background |
Mandatory |
|
vegmask_min_value |
Int |
Maximum allowed value in the vegetation mask |
Mandatory |
|
binary_closing |
Int |
Size of disk structuring element |
Mandatory |
|
binary_opening |
Int |
Size of disk structuring element |
Mandatory |
|
categorized_watermask |
Bool (Default False) |
If true, stack_mask will infer water body category (lake, river, sea, unknown) from a general water body mask |
Optional |
|
minimal_size_water_area |
Int (Default 10000) |
Minimal area (in pixels) of water bodies |
Optional |