English | 简体中文
This project reproduces HRNet_W48_Contrast based on paddlepaddle framework. The core idea of pixel-wise contrastive algorithm is to force pixel embeddings belonging to a same semantic class to be more similar than embeddings from different classes. It has two advantages. Firstly, pixel-wise contrastive algorithm can address the categorization ability of individual pixel embeddings. Secondly, pixel embeddings be well structured to addrress intra-class compactness and inter-class dispersion.
Paper:
- [1] Wenguan Wang, Tianfei Zhou, Fisher Yu , Jifeng Dai, Ender Konukoglu, Luc Van Gool. Exploring Cross-Image Pixel Contrast for Semantic Segmentation
Reference project:
This index is test in the val set of CityScapes. HRNet_W48 was pretrained in ImageNet.
steps | opt | image_size | batch_size | dataset | memory | card | mIou | config | |
---|---|---|---|---|---|---|---|---|---|
HRNet_W48_contrast | 60k | sgd | 1024x512 | 2 | CityScapes | 32G | 4 | 0.8266 | HRNet_W48_cityscapes_1024x512_60k.yml |
- Dataset size:
- train: 2975
- val: 500
-
Hardware: Tesla V100 * 4
-
Framework:
- PaddlePaddle == 2.1.2
# clone this repo
git clone https://github.com/justld/contrast_seg_paddle.git
cd contrast_seg_paddle
Install packages
pip install -r requirements.txt
python train.py --config configs/HRNet_W48_cityscapes_1024x512_60k.yml --do_eval --use_vdl --log_iter 100 --save_interval 1000 --save_dir output
If you want to train distributed and use multicards:
python -m paddle.distributed.launch train.py --config configs/HRNet_W48_cityscapes_1024x512_60k.yml --do_eval --use_vdl --log_iter 100 --save_interval 1000 --save_dir output
You can download the pretrained model in BaiduYun. (Extraction code: hwq7)
python val.py --config configs/HRNet_W48_cityscapes_1024x512_60k.yml --model_path output/best_model/model.pdparams
Structure
├─configs
├─images
├─output
├─paddleseg
│ export.py
│ predict.py
│ README.md
│ README_CN.md
│ requirements.txt
│ setup.py
│ train.py
│ val.py
For other information about the model, please refer to the following table:
information | description |
---|---|
Author | du lang |
Date | 2021.09 |
Framework version | Paddle 2.1.2 |
Application scenarios | Semantic Segmentation |
Support hardware | GPU、CPU |
Online operation | notebook, Script |