Tiếng Việt | English
Binary LiDAR point cloud pipeline:
- Ground filter (SMRF or CSF)
- Merge (ground from algorithm + keep original non-ground classes)
- HAG (HeightAboveGround)
- ML binary classification (ground vs non-ground)
pip install pdal laspy numpy scikit-learn joblib matplotlib
pip install cloth-simulation-filter # only for CSF mode- Internal model labels:
1= ground0= non-ground
- LAS output labels:
- ground -> class
2 - non-ground -> class
1
- ground -> class
Defaults are in config.json.
| Section | Parameters |
|---|---|
smrf |
slope, window, threshold, scalar |
csf |
cloth_resolution, rigidness, slope_smooth, class_threshold |
training |
max_train_points, min_class_points, sample_ratio |
random_forest |
n_jobs, n_estimators, class_weight |
# Train binary ground model with SMRF
python train_classify.py --mode train --input "data/**/*.las" --ground-method smrf \
--ml-model random-forest --model models
# Train with original labels as target (recommended when original labels are QA/QC ground truth)
python train_classify.py --mode train --input "data/**/*.las" --ground-method smrf \
--ml-model random-forest --model models --train-target original
# Train binary ground model with CSF
python train_classify.py --mode train --input "data/**/*.las" --ground-method csf \
--ml-model random-forest --model modelsOutput example (now includes train target to avoid overwrite):
models/smrf_rf_merged.savmodels/smrf_rf_orig.sav
--train-target:
merged(default): train with binary labels after ground reclassification + mergeoriginal: train with original binary labels (class 2vs non-2) while still using SMRF/CSF-derived features
# Evaluate with original binary target (default)
python train_classify.py --mode evaluate --input "test/**/*.las" --ground-method smrf \
--model models/smrf_rf_orig.sav --output-dir results
# Evaluate with merged binary target
python train_classify.py --mode evaluate --input "test/**/*.las" --ground-method smrf \
--model models/smrf_rf_merged.sav --output-dir results --eval-target merged
# Evaluate and also export predicted LAS files
python train_classify.py --mode evaluate --input "test/**/*.las" --ground-method smrf \
--model models/smrf_rf_orig.sav --output-dir results --save-eval-pred-las--eval-target:
original(default): compare with original binary labels (class 2vs non-2)merged: compare with merged binary labels after reclassification
--save-eval-pred-las output:
results/<model_name>/predicted_las/*_eval_predicted.las
# Standard predict (rerun SMRF/CSF)
python train_classify.py --mode predict --input "new/**/*.las" --ground-method smrf \
--model models/smrf_rf_orig.sav
# Predict from premerged LAS (skip SMRF/CSF rerun)
python train_classify.py --mode predict --input "new/**/*.las" \
--model models/smrf_rf_orig.sav --use-premergedEach abc.las -> abc_predicted.las with binary LAS classes (2 ground, 1 non-ground).
- Keep train and predict pipelines consistent (
smrfvscsfvs--use-premerged). - Large datasets: use
--sample-ratio 0.01. - Ground quality matters most: optimize ground precision first.