This repository is based on:
- https://github.com/HRNet/HRNet-Semantic-Segmentation, the official code of high-resolution representations for Semantic Segmentation.
- https://github.com/HRNet/Lite-HRNet, the official code of [Lite-HRNet: A Lightweight High-Resolution Network] (https://arxiv.org/abs/2104.06403).
- https://github.com/shachoi/HANet, the official code of [Cars Can't Fly Up in the Sky: Improving Urban-Scene Segmentation via Height-Driven Attention Networks] (https://arxiv.org/abs/2003.05128)
- Clone this repository and install the dependencies: pip install -r requirements.txt
Download the Cityscapes
Your directory tree should be look like this:
$SEG_ROOT/data
├── cityscapes
│ ├── gtFine
│ │ ├── test
│ │ ├── train
│ │ └── val
│ └── leftImg8bit
│ ├── test
│ ├── train
│ └── val
├── lip
│ ├── TrainVal_images
│ │ ├── train_images
│ │ └── val_images
│ └── TrainVal_parsing_annotations
│ ├── train_segmentations
│ ├── train_segmentations_reversed
│ └── val_segmentations
├── pascal_ctx
│ ├── common
│ ├── PythonAPI
│ ├── res
│ └── VOCdevkit
│ └── VOC2010
├── cocostuff
│ ├── train
│ │ ├── image
│ │ └── label
│ └── val
│ ├── image
│ └── label
├── ade20k
│ ├── train
│ │ ├── image
│ │ └── label
│ └── val
│ ├── image
│ └── label
├── list
│ ├── cityscapes
│ │ ├── test.lst
│ │ ├── trainval.lst
│ │ └── val.lst
│ ├── lip
│ │ ├── testvalList.txt
│ │ ├── trainList.txt
│ │ └── valList.txt
All the models files can be found in lib/models
.
The default file of HRNet model is lib/models/seg_hrnet.py
.
For adding the HANet, we modified the default file lib/models/seg_hrnt_hanet.py
, and we added the following files:
lib/models/deepv3.py
.lib/models/HANet.py
.lib/models/PosEmbedding_HANet.py
.lib/models/mynn_HANet.py
.
For lite-HRNet, we added the following files:
lib/models/litehrnet.py
.lib/core/resnet.py
.
- Specify the training script in
tools/
. a. For trainig the (hrnet) models use thetools/train.py
. b. For trainig the (lite-hrnet) models use thetools/lite-train.py
. - Specify the configuration file (.yaml) of the experiment in
experiments/cityscapes
.
Here are some examples scripts to start training:
Training HRNet-W32 on Cityscapes with a batch size of 8:
python tools/train.py --cfg experiments/cityscapes/seg_hrnet_w32.yaml
Training Lite-HRNet-W32 on Cityscapes with a batch size of 8:
python tools/lite_train.py --cfg experiments/cityscapes/seg_lite_hrnet_w32.yaml
@inproceedings{SunXLW19,
title={Deep High-Resolution Representation Learning for Human Pose Estimation},
author={Ke Sun and Bin Xiao and Dong Liu and Jingdong Wang},
booktitle={CVPR},
year={2019}
}
@article{WangSCJDZLMTWLX19,
title={Deep High-Resolution Representation Learning for Visual Recognition},
author={Jingdong Wang and Ke Sun and Tianheng Cheng and
Borui Jiang and Chaorui Deng and Yang Zhao and Dong Liu and Yadong Mu and
Mingkui Tan and Xinggang Wang and Wenyu Liu and Bin Xiao},
journal={TPAMI},
year={2019}
}
@inproceedings{Yulitehrnet21,
title={Lite-HRNet: A Lightweight High-Resolution Network},
author={Yu, Changqian and Xiao, Bin and Gao, Changxin and Yuan, Lu and Zhang, Lei and Sang, Nong and Wang, Jingdong},
booktitle={CVPR},
year={2021}
}
@InProceedings{Choi_2020_CVPR,
author = {Choi, Sungha and Kim, Joanne T. and Choo, Jaegul},
title = {Cars Can't Fly Up in the Sky: Improving Urban-Scene Segmentation via Height-Driven Attention Networks},
booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2020}
}
[1] Deep High-Resolution Representation Learning for Visual Recognition. Jingdong Wang, Ke Sun, Tianheng Cheng, Borui Jiang, Chaorui Deng, Yang Zhao, Dong Liu, Yadong Mu, Mingkui Tan, Xinggang Wang, Wenyu Liu, Bin Xiao. Accepted by TPAMI. download
We adopt sync-bn implemented by InplaceABN for PyTorch 0.4.1 experiments and the official sync-bn provided by PyTorch for PyTorch 1.10 experiments.
We adopt data precosessing on the PASCAL-Context dataset, implemented by PASCAL API.