Production-oriented pipeline for extracting lawn polygons and per-point lawn labels from dense outdoor point clouds.
- Segment lawn areas robustly in dense street scans.
- Support very large scenes (millions of points).
- Export GIS-ready vector outputs and point cloud predictions with preserved CRS.
- Provide a GUI workflow for non-code operation.
The current pipeline is a hybrid method:
CSF(Cloth Simulation Filter) removes non-ground points.- A
2.5D U-Netperformslawn vs non-lawnsegmentation on ground-only data. - Predictions are projected back to points and exported as:
point_predictions.lazlawn_polygons.gpkg
Why this approach:
- Better robustness against trees/buildings than plain raster segmentation.
- Lower memory footprint than full 3D sparse models.
- Strong GIS compatibility.
configs/default.yaml: default pipeline config.scripts/prepare_dataset.py: tile generation for training.scripts/train_stage2.py: stage-2 model training.scripts/infer_scene.py: single-scene inference.scripts/gui_app.py: full GUI launcher.src/csf_filter.py: CSF ground filtering wrapper.src/raster.py: 2.5D feature rasterization and tiling.src/models/unet2d.py: 2D U-Net segmentation model.src/train_utils.py: training loop and metrics.src/infer_utils.py: tiled inference and point projection.src/io_utils.py: scene reading/writing, LAZ export.src/vectorize_utils.py: polygonization and GPKG export.run.bat: one-click setup and GUI start for Windows.
See full details in docs/SYSTEM_REQUIREMENTS.md.
Baseline target:
- Python
3.11 - CUDA
11.8(PyTorch cu118 build) - NVIDIA GPU with 6 GB+ VRAM recommended
- Windows 10/11 x64
- Place data in expected folders:
data/raw/traindata/raw/val
- Launch:
run.batrun.bat will:
- create/update temporary venv (
.venv_temp_gui) - install dependencies
- install PyTorch CUDA 11.8 build
- start GUI
python scripts/prepare_dataset.py --config configs/default.yamlpython scripts/train_stage2.py --config configs/default.yaml --weights-out artifacts/models/stage2_lawn_vs_nonlawn.ptpython scripts/infer_scene.py --config configs/default.yaml --scene data/raw/val/scene_001.laz --out-dir outputs/scene_001 --weights artifacts/models/stage2_lawn_vs_nonlawn.pt --minimal-outputsMinimal mode (--minimal-outputs):
point_predictions.lazlawn_polygons.gpkg
Full mode:
point_predictions.lazlawn_polygons.gpkglawn_polygons.geojsonlawn_polygons.shpclass_raster.tiflawn_mask.tifcsf_ground_mask.npzpoint_labels.npz
Training scenes require:
x, y, z, intensity, label
Inference scenes require:
x, y, z, intensitylabel/classificationoptional
Supported formats:
.laz/.las.npz.csv
- CRS is read from input LAS/LAZ when available.
- LAZ prediction output preserves original dimensions and CRS metadata.
- GPKG polygons are written with CRS WKT.
- Full settings editing in UI (self-contained, no manual YAML required).
- Batch inference over multiple files.
- Per-file output subfolders.
- Weights file selection for train/inference.
- Detailed live logs.
- Status checks:
TorchCUDAModel checkpoint load- RU/EN language switch.
docs/SYSTEM_REQUIREMENTS.mddocs/METHODS.mddocs/INSTALLATION.mddocs/USAGE.mddocs/DATA_FORMAT.md- docs/TRAINING_DATA_PREP.md
Current model predicts lawn-oriented classes only (lawn vs non-lawn ground after CSF filtering). This repository is structured for extension to more vegetation classes.