sithu31296 / semantic-segmentation

SOTA Semantic Segmentation Models in PyTorch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

inference with a pretrained model

Tsardoz opened this issue · comments

Hi this looks great but I am a bit confused.
I want to use a pretrained topformer model for inference for evaluation then maybe to use it for custom training.
I am confused about the steps.
I downloaded a model from here https://github.com/hustvl/TopFormer
In the ade20k.yaml file what do I put for the BACKBONE (in MODEL)? Also for PRETRAINED?
Or is the BACKBONE the starting weights for transfer learning?

Hi, I am sorry for confusion. TopFormer is not updated in this repo yet. I am updating the whole codebase and will release later.

Thanks but I am still confused.
If I download any segformer model from their git even the B3 used as demo (and shows it working well) I get terrible results.
eg. segformer.b3.512x512.ade.160k from https://drive.google.com/drive/folders/1GAku0G0iR9DsBxCbfENWMJ27c5lYUeQA
Is the format different? Do I need to retrain the model?
B0 looks like it might compete with Topformer but again, terrible results with a downloaded pretrain.

I suggest to use the pretrained models provided in this repo from here. Not all of the weights from official repositories are compatible with the modified (simplified) code base in this repo. But still it should work after modifying some of the keys and values in the pretrained weights. This is the example result I tested with the SegFormer-B2 model. The result is pretty good.