GRASS logo

NAME

m.neural_network.preparedata_part1 - Prepare data for creating a neuronal network or applying a neuronal network

KEYWORDS

raster, vector, export, neural network, preparation

SYNOPSIS

m.neural_network.preparedata_part1
m.neural_network.preparedata_part1 --help
m.neural_network.preparedata_part1 [-l] tindex=name image_bands=name[,name,...] [ndsm=name] [dsm=name] [dtm=name] [ndsm_out=name] [reference=name] [segmentation_minsize=integer] [segmentation_threshold=float] [imagery_scale_min=integer] [imagery_scale_max=integer] [label_qml=name] output_dir=name [nprocs=integer] [--overwrite] [--help] [--verbose] [--quiet] [--ui]

Flags:

-l
Prepare labels for training data
Option for preparing labels for training data. If not set, only the tiles for the image bands and nDSM are exported, but no segmentation and labeling is performed.
--overwrite
Allow output files to overwrite existing files
--help
Print usage summary
--verbose
Verbose module output
--quiet
Quiet module output
--ui
Force launching GUI dialog

Parameters:

tindex=name [required]
tindex file for tiling.
must be created with m.neural_network.tindex
image_bands=name[,name,...] [required]
The names of imagery raster bands, e.g. for DOPs RGBI raster bands
The first raster defines the output resolution
ndsm=name
Name of the nDSM raster
Name of input raster map
dsm=name
Name of the DSM raster
Name of input raster map
dtm=name
Name of the DTM raster
Name of input raster map
ndsm_out=name
Name for the computed nDSM raster
Name for output raster map
reference=name
Name of the reference vector map
Or data source for direct OGR access
segmentation_minsize=integer
Minimum number of cells in a segment
Default: 80
segmentation_threshold=float
Difference threshold between 0 and 1 for the segments
Threshold = 0 merges only identical segments; threshold = 1 merges all
Default: 0.3
imagery_scale_min=integer
minimum scaling value for imagery
Default: 1
imagery_scale_max=integer
maximum scaling value for imagery
Default: 255
label_qml=name
Optional qml file, for training data or rather exported label files. If not given, the label.qml within this repo is used for a binary tree classification.
output_dir=name [required]
Directory where the prepared data should be stored
The directory will be split into train and apply
nprocs=integer
Number of threads for parallel computing
0: use OpenMP default; >0: use nprocs; <0: use MAX-nprocs
Default: 0

Table of contents

DESCRIPTION

m.neural_network.preparedata_part1 export tiles for the labeling
process (as part of the training data preparation of a neural network) or for model application, using imagery (e.g. DOPs) and optional nDSM as input data.

Additionally, reference labels can be given for training data preparation. Expect attribute class_number with the labeled class values within reference data.
If attribute not given, these column will be added and initialized with value 0.

The addon expects a tileindex as input, including information about the extent of the tiles and if they are used for training or application of a neural network.

EXAMPLES

Prepare the training or apply data for a neural network

Note: information which type (training or apply) given within tindex

m.neural_network.preparedata_part1 tindex=/mnt/data/tindex.gpkg image_bands=top_red_02,top_green_02,top_blue_02,top_nir_02 ndsm=ndsm output_dir=/mnt/data/prepare_part1 nprocs=7

Prepare data and computing ndsm on the fly

Note: will be kept within mapset, where Addon is executed

m.neural_network.preparedata_part1 tindex=/mnt/data/tindex.gpkg image_bands=top_red_02,top_green_02,top_blue_02,top_nir_02 dsm=dsm dtm=dtm ndsm_out=ndsm output_dir=/mnt/data/prepare_part1 nprocs=7

Prepare training data without ndsm but reference labels

Note: label preparation, requires flag -l

m.neural_network.preparedata_part1 tindex=/mnt/data/tindex.gpkg image_bands=top_red_02,top_green_02,top_blue_02,top_nir_02 reference=reference_labels -l output_dir=/mnt/data/prepare_part1 nprocs=7

SEE ALSO

g.region, r.univar,

AUTHORS

Anika Weinmann, mundialis GmbH & Co. KG
Guido Riembauer, mundialis GmbH & Co. KG
Victoria-Leandra Brunn, mundialis GmbH & Co.
KG

SOURCE CODE

Available at: m.neural_network.preparedata_part1 source code (history)

Accessed: Sunday Nov 15 11:00:36 2026


Main index | Miscellaneous index | Topics index | Keywords index | Graphical index | Full index

© 2003-2026 GRASS Development Team, GRASS 8.5.1dev Reference Manual