Files
depth_edges_annotate_worlduav/scripts/seg_classes.py
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

31 lines
1.1 KiB
Python

"""Unified segmentation classes shared across all datasets.
All datasets MUST use the same prompt list and class IDs to enable
transfer learning (e.g., pretrain on GTA-UAV → fine-tune on UAV_VisLoc).
Not every dataset will have pixels for every class — that's fine.
A class with 0 pixels simply won't contribute to training loss.
"""
UNIFIED_PROMPTS: list[str] = [
"background", # 0
"building", # 1
"road", # 2
"vegetation", # 3
"water", # 4
"sand and gravel ground", # 5
"rocky terrain", # 6
"farmland", # 7
"railway", # 8
"parking lot", # 9
"sidewalk", # 10
"bare soil and plowed field", # 11
"roof and rooftop", # 12
"sports field and playground", # 13
"muddy ground and wetland", # 14
"embankment and levee", # 15
"swimming pool", # 16
]
NUM_CLASSES = len(UNIFIED_PROMPTS) # 17