remap_smp_segformer_state_dict¶

remap_smp_segformer_state_dict(state_dict)[source]¶

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

Classifier / head tensor shapes are passed through unchanged, so checkpoints that only differ by num_labels (output classes) are supported when the model is constructed with a matching classes value.

Parameters:

state_dict (Mapping[str, torch.Tensor])

Return type:

dict[str, torch.Tensor]