Skip to content

CLI Reference

Writes an annotated example config to a file, or prints it to stdout if no path is given.

Terminal window
mapcv init my_dataset.yaml

Open the file and fill in your region, tile source, and label path. Everything else has sensible defaults.


Parses and validates a config file without downloading any tiles or writing any files. Run this after editing your config to catch errors before a long download.

Terminal window
mapcv validate my_dataset.yaml

Runs the full pipeline: tile download, label rasterization, patch sampling, and dataset writing.

Terminal window
mapcv generate my_dataset.yaml

When it finishes you will find:

output/
Images/
patch_0000000.png
patch_0000001.png
...
Masks/
patch_0000000.png
patch_0000001.png
...
manifest.json
splits/
train.txt
val.txt
test.txt

Mask pixels are 0 for background and 1..255 for class IDs. If no labels section is present in the config, no Masks/ directory is written. If no split section is present, no splits/ directory is written.


Re-splits an existing dataset using its manifest.json without re-downloading or re-processing anything. Useful when you want to try different split ratios without rerunning the full pipeline.

Terminal window
mapcv split [OPTIONS] STAGING_DIR
OptionDefaultDescription
--test-ratio0.2Fraction of all patches reserved for test.
--val-ratio0.1Fraction of remainder used for validation.
--labeled-ratios0.10 0.20 0.30Optional. Pass once per ratio, e.g. --labeled-ratios 0.10 --labeled-ratios 0.20.
--seed42Random seed.
--strategystratifiedrandom or stratified.
--sample-limitOptional. Cap on total patches sampled.
Terminal window
mapcv split ./output --test-ratio 0.15 --val-ratio 0.10

Split files are written to STAGING_DIR/splits/ (e.g. output/splits/train.txt).