Files
depth_edges_annotate_worlduav/CLAUDE.md
pikaliov 3b5778e303 Unify segmentation classes (17) across GTA-UAV and UAV_VisLoc
Extract shared UNIFIED_PROMPTS (17 classes, ID 0-16) into
scripts/seg_classes.py for transfer learning compatibility.
Both run_gta_uav.py and run_uav_visloc.py now import from it.

Key change: swimming pool moved from ID 13 → ID 16, so sports field
(ID 13), muddy ground (14), embankment (15) have stable IDs across
both datasets. Missing classes in a dataset = 0 pixels = 0 loss.

Updated: README, CLAUDE.md, segmentation_class_analysis.md, palette.
Deleted old UAV_VisLoc segmentations (need regeneration with 17 classes).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-17 22:06:10 +03:00

54 lines
2.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# CLAUDE.md
## Что это за проект
Пайплайн автоматической генерации 4 вспомогательных модальностей (depth, edges, segmentation, canopy height) из RGB-изображений аэрофотоснимков. Используется для подготовки обучающих данных для NADEZHDA — системы cross-view geolocalization (БПЛА ↔ спутник).
## Быстрый старт
```bash
# World-UAV (973K images, основной датасет)
python -m src.main
# UAV_VisLoc (81K images)
python scripts/run_uav_visloc.py
# GTA-UAV-LR (48K images, synthetic GTA V)
python scripts/run_gta_uav.py
# Тесты (143 шт, без GPU)
python -m pytest src/tests/ -v
```
## Ключевые решения
- **Формат выхода:** SafeTensors (zero-copy mmap, ~0.1ms чтение). Не NPY, не PNG, не `.pt`.
- **Структура директорий:** модальность = папка (`depth/`, `edge/`, `segm/`, `chm/`, `safetensors/`), не суффикс файла.
- **Стадии последовательно** — одна модель в GPU за раз (экономия VRAM).
- **Сегментация:** SegEarth-OV3 (SAM 3.1 + open-vocabulary prompts). 11 классов для World-UAV, **17 unified** для UAV_VisLoc + GTA-UAV (единые ID для transfer learning).
- **CHMv2 только FP32** — в FP16 NaN.
## Структура кода
```
src/main.py — точка входа, оркестрация стадий
src/augmentor/ — inference, I/O, dataset discovery
src/conf/ — gin-configurable dataclasses
src/nn/ — вендорированные DA3 + SegEarth-OV3
scripts/ — run_uav_visloc.py, migrate_layout.py
in/config_files/ — gin-конфиги
docs/ — документация
```
## Конфигурация
Все параметры через gin. CLI override: `--gin "PipelineConfig.source = 'db'"`.
Для нового датасета — создать скрипт в `scripts/` (пример: `run_uav_visloc.py`), не новый gin-файл.
## Что НЕ делать
- Не добавлять классы сегментации в `segmentation.gin` для конкретного датасета — использовать `scripts/seg_classes.py` (единый набор 17 классов для transfer learning).
- Не использовать `.pt` (torch.save) для хранения тензоров — pickle, медленно.
- Не рендерить depth/seg в RGB colormap для обучения — OOD для DINOv3, потеря информации.