segformer_hf¶

Hugging Face SegFormer helpers: MiT configs and SMP checkpoint remapping.

Architecture weights are loaded into transformers.SegformerForSemanticSegmentation. This module remaps older SMP-style SegFormer state dicts to HF key names (transformers>=5.15 layout: stages.*, q_proj, linear_projections).

Functions

is_smp_segformer_state_dict

Return True if state_dict uses TIA/SMP SegFormer key names.

remap_smp_segformer_state_dict

Remap a TIA/SMP SegFormer checkpoint to Hugging Face key names.