Giter VIP home page Giter VIP logo

iduta / pyconvsegnet Goto Github PK

View Code? Open in Web Editor NEW
36.0 3.0 5.0 1.6 MB

Semantic Segmentation PyTorch code for our paper: Pyramidal Convolution: Rethinking Convolutional Neural Networks for Visual Recognition (https://arxiv.org/pdf/2006.11538.pdf)

License: MIT License

Python 75.53% Shell 0.57% C++ 11.14% Cuda 12.77%
semantic-segmentation scene-parsing ade20k pytorch scene-recognition deep-learning computer-vision pattern-recognition machine-learning neural-networks pyconv segmentation

pyconvsegnet's Introduction

Pyramidal Convolution on semantic segmentation

This is the PyTorch implementation of our paper "Pyramidal Convolution: Rethinking Convolutional Neural Networks for Visual Recognition". (Note that this is the code for semantic image segmentation/parsing. For image recognition on ImageNet see this repository: https://github.com/iduta/pyconv)

Pyramidal Convolution Segmentation Network: PyConvSegNet

The models trained on ADE20K dataset can be found here.

The results on the ADE20K validation set of our PyConvSegNet (using multi-scale inference):

Backbone mean IoU pixel Acc.
ResNet-50 42.88% 80.97% (model)
PyConvResNet-50 43.31% 81.18% (model)
ResNet-101 44.39% 81.60% (model)
PyConvResNet-101 44.58% 81.77% (model)
ResNet-152 45.28% 81.89% (model)
PyConvResNet-152 45.64% 82.36% (model)

Our single model top result (mIoU=39.13, pAcc=73.91, score=56.52) on the testing set is obtained with PyConvResNet-152 as backbone and performing the training on train+val sets over 120 epochs (model).

Requirements

Install PyTorch pip install -r requirements.txt

A fast alternative (without the need to install PyTorch and other deep learning libraries) is to use NVIDIA-Docker, we used this container image.

Download the ImageNet pretrained models and add the corresponding path to the config .yaml file.

Download the ADE20K dataset. (note that this code uses label id starting from 0, while the original ids start from 1, thus, you need to preprocess the original labels by subtracting 1)

Training and Inference

To train a model on ADE20K dataset, for instance, using PyConvResNet with 50 layers as backbone (note that you need to update the config file, for instance, config/ade20k/pyconvresnet50_pyconvsegnet.yaml):

./tool/train.sh ade20k pyconvresnet50_pyconvsegnet

Run the inference on the validation set (also update the config/ade20k/pyconvresnet50_pyconvsegnet.yaml file for the TEST part):

./tool/test.sh ade20k pyconvresnet50_pyconvsegnet

Citation

If you find our work useful, please consider citing:

@article{duta2020pyramidal,
  author  = {Ionut Cosmin Duta and Li Liu and Fan Zhu and Ling Shao},
  title   = {Pyramidal Convolution: Rethinking Convolutional Neural Networks for Visual Recognition},
  journal = {arXiv preprint arXiv:2006.11538},
  year    = {2020},
}

Acknowledgements

This code is based on this repository. We thank the authors for open-sourcing their code.

pyconvsegnet's People

Contributors

iduta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pyconvsegnet's Issues

ModuleNotFoundError

from util import dataset, transform, config

ModuleNotFoundError: No module named 'util'

Where to get validation.txt file in ADE20K dataset?

RuntimeError: Image list file do not exist: /raid/data/datasets/semanticSegmentation/ade20k/list/validation.txt

To solve this error I need validation.txt file from ADE20K dataset. I have tried a lot to find it but unable to find this file.

Please help me to get this file.

Thanks,
Bhavika

Getting Error while prediction?

hi @iduta
Thanks for sharing the code.

When I run the test.py file, I got the following error. Please help me to solve this error.

`[2020-07-23 17:07:58,745 INFO test.py line 62 23777] => creating model ...

[2020-07-23 17:07:58,745 INFO test.py line 63 23777] Classes: 150
Totally 1 samples in val set.
Starting Checking image&label pair val list...
Checking image&label pair val list done!
Load pretrained model: exp/PyConvADE20kModels/ade20k_pyconvresnet152_pyconvsegnet.pth
Traceback (most recent call last):
File "test.py", line 269, in
main()
File "test.py", line 95, in main
backbone_net=args.backbone_net)
File "/home/pyconvsegnet/model/pyconvsegnet.py", line 163, in init
convert_bn=BatchNorm)
File "/home/pyconvsegnet/model/build_backbone_layers.py", line 62, in build_backbone_layers
backbone.load_state_dict(torch.load(pretrained), strict=True)
File "/home/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 847, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for PyConvResNet:
Missing key(s) in state_dict: "conv1.weight", "bn1.weight", "bn1.bias", "bn1.running_mean", "bn1.running_var", "fc.weight", "fc.bias".
`

no ade20k_pyvonvsegnet152_pyvonvsegnet.yaml

Thank you for your sharing.
Could you please share your ade20k_pyvonvsegnet152_pyvonvsegnet.yaml, thers is only ade20k_pyvonvsegnet50_pyvonvsegnet.yaml in the config/ade20k.
Thank you very much.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.