Install
openclaw skills install @ruiduobao/geoskill-semantic-segmentationopenclaw skills install @ruiduobao/geoskill-semantic-segmentationPerforms per-pixel semantic segmentation of multispectral remote sensing imagery and outputs a class raster with per-class area statistics. Two modes are supported: unsupervised (KMeans) and supervised (RandomForest, requiring a label raster via --labels).
This skill is an offline numpy equivalent implementation of FCN/U-Net semantic segmentation networks: without depending on any deep learning framework, it reproduces the semantic segmentation pipeline through "feature construction -> per-pixel sklearn classifier -> sliding-window tiled prediction and stitching -> majority-filter post-processing". Unit tests cover the consistency between tiled and whole-scene prediction, the denoising effect of post-processing, and the unsupervised class-remapping matching accuracy.
pip install numpy rasterio scipy scikit-learn geopandas shapely
python geoskill-semantic-segmentation.py --bbox 116.0 39.0 117.0 40.0 --synthetic --output-dir ./out
python geoskill-semantic-segmentation.py --input scene.tif --n-classes 5 --tile 64 --smooth 5 --output-dir ./out
python geoskill-semantic-segmentation.py --bbox 116.0 39.0 117.0 40.0 --synthetic --method rf --output-dir ./out
python geoskill-semantic-segmentation.py --input scene.tif --labels labels.tif --method rf --output-dir ./out
| File | Format | Description |
|---|---|---|
segmentation.tif | GeoTIFF | Class raster (one integer class per pixel) |
class_stats.json | JSON | Per-class pixel counts and fractions |
output-manifest.json | JSON | Run manifest (inputs/outputs/QA/exit code) |
A local multi-band GeoTIFF, or a --synthetic cube of three land-cover types (vegetation/soil/water) with built-in ground truth for accuracy QA.
--synthetic mode requires no network at all.MIT
对多光谱遥感影像做逐像元语义分割,输出类别栅格与各类面积统计。支持无监督(KMeans)与有监督(RandomForest,需 --labels 标注栅格)两种模式。
本 skill 是 FCN/U-Net 语义分割网络的离线 numpy 等价实现:不依赖深度学习框架,用"特征构建 -> 逐像元 sklearn 分类器 -> 滑窗分块预测拼接 -> 众数滤波后处理"复现语义分割流程;分块预测与整幅预测的一致性、后处理去噪效果、无监督类别置换匹配精度均有单元测试覆盖。
pip install numpy rasterio scipy scikit-learn geopandas shapely
python geoskill-semantic-segmentation.py --bbox 116.0 39.0 117.0 40.0 --synthetic --output-dir ./out
python geoskill-semantic-segmentation.py --input scene.tif --n-classes 5 --tile 64 --smooth 5 --output-dir ./out
python geoskill-semantic-segmentation.py --bbox 116.0 39.0 117.0 40.0 --synthetic --method rf --output-dir ./out
python geoskill-semantic-segmentation.py --input scene.tif --labels labels.tif --method rf --output-dir ./out
| 文件 | 格式 | 说明 |
|---|---|---|
segmentation.tif | GeoTIFF | 类别栅格(每像元一个整数类别) |
class_stats.json | JSON | 各类像元数与占比 |
output-manifest.json | JSON | 运行清单(输入/输出/QA/退出码) |
本地多波段 GeoTIFF,或 --synthetic 合成三体物(植被/土壤/水体)立方体(自带真值用于精度 QA)。
--synthetic 模式完全无网络。MIT