Tramac / awesome-semantic-segmentation-pytorch

Semantic Segmentation on PyTorch (include FCN, PSPNet, Deeplabv3, Deeplabv3+, DANet, DenseASPP, BiSeNet, EncNet, DUNet, ICNet, ENet, OCNet, CCNet, PSANet, CGNet, ESPNet, LEDNet, DFANet)
Apache License 2.0
2.82k stars 581 forks source link

Result of ICNet on cityscapes #89

Open RAYRAYRAYRita opened 4 years ago

RAYRAYRAYRita commented 4 years ago

Thanks too much for your sharing code! I trained the icnet on cityscapes, but best mIoU I got was around 58% My config: aux=True, backbone='resnet50', base_size=520, batch_size=4, crop_size=960, dataset='citys', device='cuda', distributed=False, epochs=120, jpu=False, lr=0.01, model='icnet', use_ohem=False,

Appreciate it if you could give me some advice to improve mIoU!

pyradd commented 4 years ago

Try with a different backbone i.e.- resnet101

RAYRAYRAYRita commented 4 years ago

@MohiFaruq Thanks for your reply. I'll have a try~

pyradd commented 4 years ago

If that does not hep, try a different model i.e. deeplab-v3 on cityscapes. For sure you will have an improved IoU

RAYRAYRAYRita commented 4 years ago

@pyradd I tried resnet101. Because I have just a single GPU, I set batch-size to 2 and mIoU is about 56% My research is for autonomous driving. That's the reason why I want to try a real-time network. Maybe I should try some other real-time networks. Thanks again for your reply!~

liminn commented 4 years ago

@pyradd I change some hyper paramaters, and the config is : " aux=True, backbone='resnet50', base_size=1024, batch_size=8 crop_size=720, dataset='citys', device='cuda', distributed=False, epochs=200, lr=0.01, model='icnet' "

And the mIoU is about 59.5%. Does anyone know how to get better results?

step404 commented 4 years ago

@liminn

class _ICHead(nn.Module): def init(self, nclass, norm_layer=nn.BatchNorm2d, kwargs): super(_ICHead, self).init() self.cff_12 = CascadeFeatureFusion(512, 64, 128, nclass, norm_layer, kwargs) self.cff_24 = CascadeFeatureFusion(2048, 512, 128, nclass, norm_layer, **kwargs) self.conv_cls = nn.Conv2d(128, nclass, 1, bias=False) def forward(self, x_sub1, x_sub2, x_sub4): outputs = list() x_cff_24, x_24_cls = self.cff_24(x_sub4, x_sub2) outputs.append(x_24_cls) x_cff_12, x_12_cls = self.cff_12(x_sub2, x_sub1) outputs.append(x_12_cls) up_x2 = F.interpolate(x_cff_12, scale_factor=2, mode='bilinear', align_corners=True) up_x2 = self.conv_cls(up_x2) outputs.append(up_x2) up_x8 = F.interpolate(up_x2, scale_factor=4, mode='bilinear', align_corners=True) outputs.append(up_x8)

1 -> 1/4 -> 1/8 -> 1/16

    outputs.reverse()
    return outputs

Maybe change "x_cff_12, x_12_cls = self.cff_12(x_sub2, x_sub1)" to "x_cff_12, x_12_cls = self.cff_12(x_cff_24, x_sub1)".

RAYRAYRAYRita commented 4 years ago

@yangxudong9 I saw your question on another new issue and agree with your point. May I know your mIoU after change?

liminn commented 4 years ago

@yangxudong9
Yes, I agree with your view. I have made several changes to ICNet, and I have experimentally verified that these changes can make ICNet achieve the results in the paper, here are my experimental results and some findings: modified ICNet