CSAILVision/semantic-segmentation-pytorch

How to use other models for other projects??

Uehwan opened this issue · 2 comments

The notebook demo contains the following part:

net_encoder = ModelBuilder.build_encoder(
arch='resnet50dilated',
fc_dim=2048,
weights='ckpt/ade20k-resnet50dilated-ppm_deepsup/encoder_epoch_20.pth')
net_decoder = ModelBuilder.build_decoder(
arch='ppm_deepsup',
fc_dim=2048,
num_class=150,
weights='ckpt/ade20k-resnet50dilated-ppm_deepsup/decoder_epoch_20.pth',
use_softmax=True)

I'm wondering how I can use other networks such as HRNet.
The tricky part is how to specify fc_dim, etc.
Plus, the code in "from mit_semseg.models import ModelBuilder, SegmentationModule" does not contain the code for defining the decoder part of HRNet.

Thank you in advance.

fc_dim for HRNet is 720
decoder part for HRNet is 'C1'

So yor code for HRNet should be as follows:

net_encoder = ModelBuilder.build_encoder(
arch='hrnetv2',
fc_dim=720,
weights=''ckpt/ade20k-hrnetv2-c1/encoder_epoch_30.pth')
net_decoder = ModelBuilder.build_decoder(
arch='c1',
fc_dim=720,
num_class=150,
weights=''ckpt/ade20k-hrnetv2-c1/decoder_epoch_30.pth',
use_softmax=True)