# Deep Dual-resolution Networks for Real-time and Accurate Semantic Segmentation of Road Scenes
## Introduction
This is the unofficial code of [Deep Dual-resolution Networks for Real-time and Accurate Semantic Segmentation of Road Scenes](https://arxiv.org/pdf/2101.06085.pdf). which achieve state-of-the-art trade-off between accuracy and speed on cityscapes and camvid, without using inference acceleration and extra data!on single 2080Ti GPU, DDRNet-23-slim yields 77.4% mIoU at 109 FPS on Cityscapes test set and 74.4% mIoU at 230 FPS on CamVid test set.
The code mainly borrows from [HRNet-Semantic-Segmentation OCR](https://github.com/HRNet/HRNet-Semantic-Segmentation/tree/HRNet-OCR) and [the official repository](https://github.com/ydhongHIT/DDRNet), thanks for their work.
<!-- ![](figures/ddrnet.png) -->
<figure>
<text-align: center;>
<center>
<img src="./figures/ddrnet.png" alt="hrnet" title="" width="400" height="400" />
</center>
</figcaption>
</figure>
## requirements
Here I list the software and hardware used in my experiment
- pytorch==1.7.0
- 3080*2
- cuda==11.1
## Quick start
### 0. Data preparation
You need to download the [Cityscapes](https://www.cityscapes-dataset.com/)datasets. and rename the folder `cityscapes`, then put the data under `data` folder.
```
└── data
├── cityscapes
└── list
```
### 1. Pretrained model
download the pretrained model on imagenet or the segmentation model from the [official](https://github.com/ydhongHIT/DDRNet),and put the files in `${PROJECT}/pretrained_models` folder
## VAL
use the [official pretrained model](https://github.com/ydhongHIT/DDRNet) and our `eval.py` code. with [ydhongHIT's](https://github.com/ydhongHIT) advice now can reach the same accuracy in the paper. Thanks.
```python
cd ${PROJECT}
python tools/eval.py --cfg experiments/cityscapes/ddrnet23_slim.yaml
```
| model | Train Set | Test Set | OHEM | Multi-scale| Flip | mIoU | Link |
| :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: |
| DDRNet23_slim | unknown | eval | Yes | No | No | 77.83 | [official](https://github.com/ydhongHIT/DDRNet) |
| DDRNet23_slim | unknown | eval | Yes | No | Yes| 78.42 | [official](https://github.com/ydhongHIT/DDRNet) |
| DDRNet23 | unknown | eval | Yes | No | No | 79.51 | [official](https://github.com/ydhongHIT/DDRNet) |
| DDRNet23 | unknown | eval | Yes | No | Yes| 79.98 | [official](https://github.com/ydhongHIT/DDRNet) |
**Note**
- with the `ALIGN_CORNERS: false` in `***.yaml` will reach higher accuracy.
## TRAIN
download [the imagenet pretrained model](https://github.com/ydhongHIT/DDRNet), and then train the model with 2 nvidia-3080
```python
cd ${PROJECT}
python -m torch.distributed.launch --nproc_per_node=2 tools/train.py --cfg experiments/cityscapes/ddrnet23_slim.yaml
```
**the own trained model coming soon**
## OWN model
| model | Train Set | Test Set | OHEM | Multi-scale| Flip | mIoU | Link |
| :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: |
| DDRNet23_slim | train | eval | Yes | No | Yes | 77.77 | [Baidu/password:it2s](https://pan.baidu.com/s/17pOOTc-HBG6TNf4k_cn4VA) |
| DDRNet23_slim | train | eval | Yes | Yes| Yes | 79.57 | [Baidu/password:it2s](https://pan.baidu.com/s/17pOOTc-HBG6TNf4k_cn4VA) |
| DDRNet23 | train | eval | Yes | No | Yes | ~ | None |
| DDRNet39 | train | eval | Yes | No | Yes | ~ | None |
**Note**
- set the `ALIGN_CORNERS: true` in `***.yaml`, because i use the default setting in [HRNet-Semantic-Segmentation OCR](https://github.com/HRNet/HRNet-Semantic-Segmentation/tree/HRNet-OCR).
- Multi-scale with scales: 0.5,0.75,1.0,1.25,1.5,1.75. it runs too slow.
- from [ydhongHIT](https://github.com/ydhongHIT), can change the `align_corners=True` with better performance, the default option is `False`
#tensorboard --log-dir=${PATH_TO_LOG}
## Reference
[1] [HRNet-Semantic-Segmentation OCR branch](https://github.com/HRNet/HRNet-Semantic-Segmentation/tree/HRNet-OCR)
[2] [the official repository](https://github.com/ydhongHIT/DDRNet)
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
实时语义分割网络DDRNet项目工程,已调试成功,运行结果展示如下 2022-05-05 07:35:32,001 Loss: 0.457, MeanIU: 0.7796, Best_mIoU: 0.7802 2022-05-05 07:35:32,001 [0.98194617 0.85180647 0.92407255 0.58784785 0.59236745 0.64585143 0.69415029 0.76973187 0.92413451 0.6401672 0.94537195 0.81574417 0.63227908 0.94934242 0.80143391 0.87566783 0.7885714 0.63113426 0.76087927] 2022-05-05 07:35:32,174 Hours: 41 2022-05-05 07:35:32,174 Done
资源详情
资源评论
资源推荐
收起资源包目录
实时语义分割网络DDRNet项目 (105个子文件)
inplace_abn_cpu.cpp 3KB
inplace_abn.cpp 2KB
inplace_abn_cuda.cu 10KB
.gitignore 116B
.gitignore 50B
common.h 3KB
inplace_abn.h 1KB
DDRNet.pytorch-main.iml 499B
LICENSE 1KB
LICENSE 1KB
train.lst 1.6MB
trainval.lst 1.47MB
trainval.lst 855KB
train.lst 773KB
trainval.lst 437KB
train.lst 375KB
val.lst 121KB
testval.lst 121KB
test.lst 92KB
test.lst 92KB
val.lst 82KB
testval.lst 82KB
val.lst 62KB
README.md 4KB
test_report.md 0B
.name 17B
ddrnet.png 53KB
ddrnet_23_ema.py 31KB
seg_hrnet_ocr.py 27KB
ddrnet23_UF.py 26KB
ddrnet_23_slim.py 26KB
hrnet.py 21KB
ddrnet23_point.py 21KB
ddrnet23_psa.py 20KB
seg_hrnet.py 18KB
ddrnet_23.py 16KB
ddrnet_39.py 15KB
train.py 12KB
function.py 11KB
base_dataset.py 11KB
map.py 10KB
utils.py 9KB
cityscapes.py 9KB
functions.py 8KB
criterion.py 7KB
bn.py 7KB
lip.py 6KB
visualize.py 6KB
rain.py 5KB
pascal_ctx.py 5KB
cocostuff.py 5KB
modelsummary.py 5KB
eval.py 5KB
demo.py 4KB
attention.py 4KB
attention.py 4KB
to_onnx.py 4KB
sampling_points.py 4KB
hrnet_config.py 4KB
ade20k.py 4KB
default.py 3KB
pointrend.py 3KB
DenseCRF.py 2KB
1.py 2KB
models.py 2KB
resnet.py 1KB
deeplab.py 1KB
rename.py 698B
__init__.py 616B
distributed.py 606B
_init_paths.py 591B
__init__.py 557B
test.py 479B
__init__.py 478B
bn_helper.py 349B
__init__.py 192B
__init__.py 115B
__init__.py 27B
__init__.py 0B
pointrend.cpython-36.pyc 3KB
modelsummary.cpython-36.pyc 3KB
sampling_points.cpython-36.pyc 3KB
attention.cpython-36.pyc 3KB
default.cpython-36.pyc 3KB
resnet.cpython-36.pyc 2KB
deeplab.cpython-36.pyc 2KB
__init__.cpython-36.pyc 410B
__init__.cpython-36.pyc 400B
__init__.cpython-36.pyc 155B
rain 0B
trainList.txt 4.26MB
testvalList.txt 638KB
valList.txt 638KB
requirements.txt 146B
events.out.tfevents.1650363332.u 37KB
events.out.tfevents.1649584262.u 86B
workspace.xml 9KB
Project_Default.xml 802B
modules.xml 297B
misc.xml 202B
共 105 条
- 1
- 2
scl6666
- 粉丝: 19
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0