Docs: clarify dense tensor maps format and training usage

All modalities are stored as dense spatial tensor maps (not RGB renders):
- depth/edge/chm: [1,H,W] float16 continuous values
- segm: [1,H,W] uint8 dense class ID map (0-16)

Add training code examples: one-hot encoding, per-class embedding,
aux-encoder injection. Document why tensors over RGB renders (70% info
loss + OOD for DINOv3).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
pikaliov
2026-04-18 04:10:57 +03:00
parent 43c81ae8a4
commit 75502b481e
2 changed files with 40 additions and 28 deletions

View File

@@ -30,7 +30,7 @@ python -m pytest src/tests/ -v
## Ключевые решения
- **Формат выхода:** SafeTensors (zero-copy mmap, ~0.1ms чтение). Не NPY, не PNG, не `.pt`.
- **Формат выхода:** SafeTensors с **dense tensor maps** (zero-copy mmap, ~0.1ms). Все модальности — прямые тензоры (float16/uint8), не RGB-рендеры.
- **Структура директорий:** модальность = папка (`depth/`, `edge/`, `segm/`, `chm/`, `safetensors/`), не суффикс файла.
- **Стадии последовательно** — одна модель в GPU за раз (экономия VRAM).
- **Сегментация:** SegEarth-OV3 (SAM 3.1 + open-vocabulary prompts). **17 unified классов** для всех датасетов (единые ID для transfer learning).
@@ -66,6 +66,6 @@ docs/ — документация
- Не менять порядок/ID классов в `scripts/seg_classes.py` — все датасеты зависят от фиксированных ID.
- Не использовать `.pt` (torch.save) для хранения тензоров — pickle, медленно.
- Не рендерить depth/seg в RGB colormap для обучения — OOD для DINOv3, потеря информации.
- Не рендерить depth/seg в RGB colormap для обучения — OOD для DINOv3, потеря ~70% информации. Использовать dense tensor maps из SafeTensors.
- Не снижать threshold ниже 0.1 — увеличивает false positives без значимого улучшения recall.
- Не менять `dark_water_std_thr` (0.18) — калибровано на GTA-UAV ocean (std 0.10-0.15). Ниже — не ловит, выше — false positives на normal images.