Giter Club home page Giter Club logo

wsss_mmseg's Introduction

Weakly-supervised Semantic Segmentation part

Introduction

This is a PyTorch implementation of Pseudo-mask Matters in Weakly-supervised Semantic Segmentation.(ICCV2021).

In this paper, we propose Coefficient of Variation Smoothing and Proportional Pseudo-mask Generation to generate high quality pseudo-mask in classification part. In segmentation part, we propose Pretended Under-Fitting strategy and Cyclic Pseudo-mask for better utilization of pseudo-mask.

Data Preparation

  1. Download VOC12 OneDrive, BaiduYun
  2. Download COCO14 BaiduYun
  3. Download pretrained models OneDrive, BaiduYun (extract code of BaiduYun: mtci)

Get Started

(data preparation)
git clone https://github.com/Eli-YiLi/WSSS_MMSeg.git
cd WSSS_MMSeg
mkdir data
cd data
ln -s [path to model files] models
ln -s [path to VOC12] voc12
ln -s [path to COCO14] coco2014
ln -s [path to your voc pseudo-mask] voc12/VOC2012/ppmg
ln -s [path to your coco pseudo-mask] coco2014/voc_format/ppmg

(install mmsegmentation(our version is 0.8.0) and mmcv(our version is 1.1.4) as MMSegmentation part)

(train and val, slurm)
bash tools/run_wsss.sh [Partition] [Dataset] [Architecture]

Other Data

  1. Pseudo_masks (if you want to skip cls phase), VOC12_OneDrive COCO14_BaiduYun
  2. Release Weights BaiduYun (extract code of BaiduYun: mtci)

MMSegmentation part


PyPI docs badge codecov license issue resolution open issues

Documentation: https://mmsegmentation.readthedocs.io/

Introduction

MMSegmentation is an open source semantic segmentation toolbox based on PyTorch. It is a part of the OpenMMLab project.

The master branch works with PyTorch 1.3 to 1.6.

demo image

Major features

  • Unified Benchmark

    We provide a unified benchmark toolbox for various semantic segmentation methods.

  • Modular Design

    We decompose the semantic segmentation framework into different components and one can easily construct a customized semantic segmentation framework by combining different modules.

  • Support of multiple methods out of box

    The toolbox directly supports popular and contemporary semantic segmentation frameworks, e.g. PSPNet, DeepLabV3, PSANet, DeepLabV3+, etc.

  • High efficiency

    The training speed is faster than or comparable to other codebases.

License

This project is released under the Apache 2.0 license.

Changelog

v0.7.0 was released in 07/10/2020. Please refer to changelog.md for details and release history.

Benchmark and model zoo

Results and models are available in the model zoo.

Supported backbones:

Supported methods:

Installation

Please refer to INSTALL.md for installation and dataset preparation.

Get Started

Please see getting_started.md for the basic usage of MMSegmentation. There are also tutorials for adding new dataset, designing data pipeline, and adding new modules.

A Colab tutorial is also provided. You may preview the notebook here or directly run on Colab.

Contributing

We appreciate all contributions to improve MMSegmentation. Please refer to CONTRIBUTING.md for the contributing guideline.

Acknowledgement

MMSegmentation is an open source project that welcome any contribution and feedback. We wish that the toolbox and benchmark could serve the growing research community by providing a flexible as well as standardized toolkit to reimplement existing methods and develop their own new semantic segmentation methods.

wsss_mmseg's People

Contributors

eli-yili avatar

Stargazers

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

Watchers

 avatar  avatar

wsss_mmseg's Issues

The error

Thanks for your code.
When I used your code, I met the following error.

tools/slurm_train.sh: line 15: srun: command not found

I think maybe because of slurm. Would you please offer the other instructions such as "PMM", the "bash dish.sh" version

Best wishes to you!

Met a little bug

Hi,

nice work!

When I used your code. I got the following error. We should use the pseudo label of ppmg. and the path of label might be fixed?
such as /2009_002281.png.jpg. Would you please give me some advice?

Best wishes to you!

FileNotFoundError: [Errno 2] No such file or directory: '/JPEGImages/2009_002281.jpg /SegmentationClassAug/2009_002281.png.jpg'

Question about COCO Pseudo Mask

Hi there! Your work is so awesome at the performence! I'd like to do something on it. But when I run the code you commited, I meet some question:

  1. What's the label '0' refer to in your ppmg_coco pseudo mask? I found that people and the background are all labeled as '0' in some pseudo masks like 000000000036.png.
  2. Is that your label mapping is showed as bellow?

CLASSES = (
'person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus', 'train',
'truck', 'boat', 'traffic light', 'fire hydrant', 'stop sign',
'parking meter', 'bench', 'bird', 'cat', 'dog', 'horse', 'sheep',
'cow', 'elephant', 'bear', 'zebra', 'giraffe', 'backpack', 'umbrella',
'handbag', 'tie', 'suitcase', 'frisbee', 'skis', 'snowboard',
'sports ball', 'kite', 'baseball bat', 'baseball glove', 'skateboard',
'surfboard', 'tennis racket', 'bottle', 'wine glass', 'cup', 'fork',
'knife', 'spoon', 'bowl', 'banana', 'apple', 'sandwich', 'orange',
'broccoli', 'carrot', 'hot dog', 'pizza', 'donut', 'cake', 'chair',
'couch', 'potted plant', 'bed', 'dining table', 'toilet', 'tv',
'laptop', 'mouse', 'remote', 'keyboard', 'cell phone', 'microwave',
'oven', 'toaster', 'sink', 'refrigerator', 'book', 'clock', 'vase',
'scissors', 'teddy bear', 'hair drier', 'toothbrush', 'banner',
'blanket', 'branch', 'bridge', 'building-other', 'bush', 'cabinet',
'cage', 'cardboard', 'carpet', 'ceiling-other', 'ceiling-tile',
'cloth', 'clothes', 'clouds', 'counter', 'cupboard', 'curtain',
'desk-stuff', 'dirt', 'door-stuff', 'fence', 'floor-marble',
'floor-other', 'floor-stone', 'floor-tile', 'floor-wood',
'flower', 'fog', 'food-other', 'fruit', 'furniture-other', 'grass',
'gravel', 'ground-other', 'hill', 'house', 'leaves', 'light', 'mat',
'metal', 'mirror-stuff', 'moss', 'mountain', 'mud', 'napkin', 'net',
'paper', 'pavement', 'pillow', 'plant-other', 'plastic', 'platform',
'playingfield', 'railing', 'railroad', 'river', 'road', 'rock', 'roof',
'rug', 'salad', 'sand', 'sea', 'shelf', 'sky-other', 'skyscraper',
'snow', 'solid-other', 'stairs', 'stone', 'straw', 'structural-other',
'table', 'tent', 'textile-other', 'towel', 'tree', 'vegetable',
'wall-brick', 'wall-concrete', 'wall-other', 'wall-panel',
'wall-stone', 'wall-tile', 'wall-wood', 'water-other', 'waterdrops',
'window-blind', 'window-other', 'wood')

TypeError: __init__() got an unexpected keyword argument 'init_cfg'

Traceback (most recent call last):
File "tools/train.py", line 161, in
main()
File "tools/train.py", line 131, in main
cfg.model, train_cfg=cfg.train_cfg, test_cfg=cfg.test_cfg)
File "/space0/yisheng/workspace/WSSS_MMSeg/mmseg/models/builder.py", line 57, in build_segmentor
return build(cfg, SEGMENTORS, dict(train_cfg=train_cfg, test_cfg=test_cfg))
File "/space0/yisheng/workspace/WSSS_MMSeg/mmseg/models/builder.py", line 32, in build
return build_from_cfg(cfg, registry, default_args)
File "/space0/yisheng/anaconda3/envs/py37pt110/lib/python3.7/site-packages/mmcv/utils/registry.py", line 171, in build_from_cfg
return obj_cls(**args)
File "/space0/yisheng/workspace/WSSS_MMSeg/mmseg/models/segmentors/encoder_decoder.py", line 37, in init
self.backbone = builder.build_backbone(backbone)
File "/space0/yisheng/workspace/WSSS_MMSeg/mmseg/models/builder.py", line 37, in build_backbone
return build(cfg, BACKBONES)
File "/space0/yisheng/workspace/WSSS_MMSeg/mmseg/models/builder.py", line 32, in build
return build_from_cfg(cfg, registry, default_args)
File "/space0/yisheng/anaconda3/envs/py37pt110/lib/python3.7/site-packages/mmcv/utils/registry.py", line 171, in build_from_cfg
return obj_cls(**args)
TypeError: init() got an unexpected keyword argument 'init_cfg'

Hello, this is my error message, it seems that the mmcv doesn't include argument 'init_cfg' in 1.1.4.
If you have changed mmcv?

RuntimError

RuntimeError: replicas_[0].size() == rebuilt_param_indices_.size() INTERNAL ASSERT FAILED at "/pytorch/torch/csrc/distributed/c10d/reducer.cpp":1326, please report a bug to PyTorch. rebuilt parameter indices size is not same as original model parameters size.538 versus 1076000

Hello, do you have any good suggestions for solving this problem, thank you

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.