Install
openclaw skills install @ruiduobao/geoskill-ai-training-data-annotation小型 U-Net 二值语义分割 (torch+CUDA) 预标注 + 主动学习不确定性选样,输出 COCO/GeoJSON 标注与不确定性栅格
openclaw skills install @ruiduobao/geoskill-ai-training-data-annotationAutomatically generates pre-annotations (pseudo-labels) for remote sensing imagery and uses active learning to select the most uncertain samples for manual review, outputting both standard COCO JSON and GeoJSON annotation formats plus an uncertainty raster.
Core model: a small U-Net (unet-lite, base=8, 3-level encoder-decoder with skip connections) performing target vs background binary semantic segmentation by default on torch + CUDA. The model infers on single-band imagery to produce an (H, W, 2) softmax probability map; the target probability is Otsu-thresholded and connected components are extracted with 8-neighborhood connectivity to generate bbox pre-annotations. Uncertainty is computed as the Shannon entropy of the probability map; the Top-k samples by regional mean entropy are selected for manual review. Pretrained weights anno_unet_weights.pt are shipped with the skill (automatically trained on GPU and persisted at first run when missing). The --method otsu classical threshold baseline is also retained for comparison and GPU-free environments.
pip install numpy rasterio scipy torch --index-url https://download.pytorch.org/whl/cu121
The classical baseline (--method otsu) does not require torch.
python geoskill-ai-training-data-annotation.py --bbox 116.0 39.0 117.0 40.0 --synthetic --output-dir ./out
python geoskill-ai-training-data-annotation.py --bbox 116.0 39.0 117.0 40.0 --synthetic --n-review 2 --output-dir ./out
python geoskill-ai-training-data-annotation.py --input scene.tif --threshold 60 --min-area 9 --format both --output-dir ./out
python geoskill-ai-training-data-annotation.py --bbox 121.0 31.0 122.0 32.0 --synthetic --format coco --output-dir ./out
| File | Format | Description |
|---|---|---|
annotations_coco.json | JSON | Standard COCO annotations (images/annotations/categories) |
annotations.geojson | GeoJSON | Georeferenced pre-annotation boxes + confidence/uncertainty/review flags |
uncertainty.tif | GeoTIFF | Per-pixel entropy (uncertainty) raster |
output-manifest.json | JSON | Run manifest (inputs/outputs/QA/exit code) |
Local GeoTIFF, or --synthetic (probability map with high entropy at boundaries; target ground truth known).
--synthetic mode requires no network at all.MIT
为遥感影像自动生成预标注(伪标签),并用主动学习挑出最不确定的样本送人工复核,输出标准 COCO JSON 与 GeoJSON 两种标注格式及不确定性栅格。
核心模型:小型 U-Net (unet-lite,base=8,3 级编解码 + skip),默认在 torch + CUDA 上做 target vs background 二值语义分割。模型对单波段影像推理得到 (H, W, 2) softmax 概率图,对 target 概率做 Otsu 阈值化 + 8 邻域连通域,生成 bbox 预标注;不确定性 = 概率图香农熵,按区域平均熵 Top-k 选样送人工复核。随附预训练权重 anno_unet_weights.pt(缺失时在首次运行时 GPU 自动训练并落盘)。同时保留 --method otsu 经典阈值基线用于对比与无 GPU 环境。
pip install numpy rasterio scipy torch --index-url https://download.pytorch.org/whl/cu121
如要跑经典基线(--method otsu)无需 torch。
python geoskill-ai-training-data-annotation.py --bbox 116.0 39.0 117.0 40.0 --synthetic --output-dir ./out
python geoskill-ai-training-data-annotation.py --bbox 116.0 39.0 117.0 40.0 --synthetic --n-review 2 --output-dir ./out
python geoskill-ai-training-data-annotation.py --input scene.tif --threshold 60 --min-area 9 --format both --output-dir ./out
python geoskill-ai-training-data-annotation.py --bbox 121.0 31.0 122.0 32.0 --synthetic --format coco --output-dir ./out
| 文件 | 格式 | 说明 |
|---|---|---|
annotations_coco.json | JSON | 标准 COCO 标注(images/annotations/categories) |
annotations.geojson | GeoJSON | 地理坐标预标注框 + 置信度/不确定性/复核标记 |
uncertainty.tif | GeoTIFF | 逐像元熵(不确定性)栅格 |
output-manifest.json | JSON | 运行清单(输入/输出/QA/退出码) |
本地 GeoTIFF,或 --synthetic(影像 + 边界高熵的概率图,目标真值已知)。
--synthetic 模式完全无网络。MIT