Skip to content

Commit 383cb53

Browse files
author
chenjun2hao
committed
add own pretrained model
1 parent 2caaa15 commit 383cb53

File tree

6 files changed

+33
-12
lines changed

6 files changed

+33
-12
lines changed

README.md

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Here I list the software and hardware used in my experiment
2727

2828
You need to download the [Cityscapes](https://www.cityscapes-dataset.com/)datasets. and rename the folder `cityscapes`, then put the data under `data` folder.
2929
```
30-
|--data
30+
└── data
3131
├── cityscapes
3232
└── list
3333
```
@@ -39,7 +39,7 @@ download the pretrained model on imagenet or the segmentation model from the [of
3939

4040
## VAL
4141

42-
use the [official pretrained model](https://github.com/ydhongHIT/DDRNet) for eval.
42+
use the [official pretrained model](https://github.com/ydhongHIT/DDRNet) and our `eval.py` code. so the result may different from official.
4343

4444
```python
4545
cd ${PROJECT}
@@ -48,10 +48,14 @@ python tools/eval.py --cfg experiments/cityscapes/ddrnet23_slim.yaml
4848

4949
| model | Train Set | Test Set | OHEM | Multi-scale| Flip | mIoU | Link |
5050
| :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: |
51-
| DDRNet23_slim | unknown | eval | unknown | No | Yes | 77.40 | [official](https://github.com/ydhongHIT/DDRNet) |
52-
| DDRNet23 | unknown | eval | unknown | No | Yes | 79.40 | [official](https://github.com/ydhongHIT/DDRNet) |
53-
| DDRNet39 | unknown | eval | unknown | No | Yes | 80.40 | [official](https://github.com/ydhongHIT/DDRNet) |
54-
| DDRNet39 | unknown | eval | unknown | Yes | Yes | 81.9 | [official](https://github.com/ydhongHIT/DDRNet) |
51+
| DDRNet23_slim | unknown | eval | Yes | No | No | 76.83 | [official](https://github.com/ydhongHIT/DDRNet) |
52+
| DDRNet23_slim | unknown | eval | Yes | No | Yes| 77.40 | [official](https://github.com/ydhongHIT/DDRNet) |
53+
| DDRNet23 | unknown | eval | Yes | No | No | 78.41 | [official](https://github.com/ydhongHIT/DDRNet) |
54+
| DDRNet23 | unknown | eval | Yes | No | Yes| 78.85 | [official](https://github.com/ydhongHIT/DDRNet) |
55+
56+
57+
**Note**
58+
- [the official repository](https://github.com/ydhongHIT/DDRNet) on DDRNet23_slim without Flip can reach 77.40 on cityscapes dataset
5559

5660

5761
## TRAIN
@@ -65,10 +69,20 @@ python -m torch.distributed.launch --nproc_per_node=2 tools/train.py --cfg exper
6569

6670
**the own trained model coming soon**
6771

72+
## OWN model
73+
| model | Train Set | Test Set | OHEM | Multi-scale| Flip | mIoU | Link |
74+
| :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: |
75+
| DDRNet23_slim | train | eval | Yes | No | Yes | 77.77 | [Baidu/password:it2s](https://pan.baidu.com/s/17pOOTc-HBG6TNf4k_cn4VA) |
76+
| DDRNet23_slim | train | eval | Yes | Yes| Yes | 79.57 | [Baidu/password:it2s](https://pan.baidu.com/s/17pOOTc-HBG6TNf4k_cn4VA) |
77+
| DDRNet23 | train | eval | Yes | No | Yes | ~ | None |
78+
| DDRNet39 | train | eval | Yes | No | Yes | ~ | None |
6879

80+
**Note**
81+
- Multi-scale with scales: 0.5,0.75,1.0,1.25,1.5,1.75. it runs too slow.
82+
- from [ydhongHIT](https://github.com/ydhongHIT), can change the `align_corners=True` with better performance, the default option is `False`
6983

7084
## Reference
71-
[1] [HRNet-Semantic-Segmentation OCR](https://github.com/HRNet/HRNet-Semantic-Segmentation/tree/HRNet-OCR)
85+
[1] [HRNet-Semantic-Segmentation OCR branch](https://github.com/HRNet/HRNet-Semantic-Segmentation/tree/HRNet-OCR)
7286

7387
[2] [the official repository](https://github.com/ydhongHIT/DDRNet)
7488

experiments/cityscapes/ddrnet23.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ TEST:
4949
- 1024
5050
BASE_SIZE: 2048
5151
BATCH_SIZE_PER_GPU: 4
52-
FLIP_TEST: true
52+
FLIP_TEST: false
5353
MULTI_SCALE: false
54-
MODEL_FILE: "pretrained_models/best_val.pth.pth"
54+
MODEL_FILE: "pretrained_models/best_val.pth"
55+
OUTPUT_INDEX: 0

experiments/cityscapes/ddrnet23_slim.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,7 @@ TEST:
5151
BATCH_SIZE_PER_GPU: 4
5252
FLIP_TEST: true
5353
MULTI_SCALE: false
54+
SCALE_LIST: [1]
55+
#0.5,0.75,1.0,1.25,1.5,1.75
5456
MODEL_FILE: "pretrained_models/best_val_smaller.pth"
57+
OUTPUT_INDEX: 0

experiments/cityscapes/ddrnet39.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ LOSS:
2222
USE_OHEM: true
2323
OHEMTHRES: 0.9
2424
OHEMKEEP: 131072
25-
BALANCE_WEIGHTS: [0.4, 1]
25+
BALANCE_WEIGHTS: [1, 0.4]
2626
TRAIN:
2727
IMAGE_SIZE:
2828
- 1024
@@ -52,3 +52,4 @@ TEST:
5252
FLIP_TEST: true
5353
MULTI_SCALE: false
5454
MODEL_FILE:
55+
OUTPUT_INDEX: 0

lib/models/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@
1010

1111
import models.seg_hrnet
1212
import models.seg_hrnet_ocr
13-
import models.ddrnet_23_slim
13+
import models.ddrnet_23_slim
14+
import models.ddrnet_23
15+
import models.ddrnet_39

tools/eval.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def parse_args():
3535

3636
parser.add_argument('--cfg',
3737
help='experiment configure file name',
38-
default="experiments/cityscapes/ddrnet_slim.yaml",
38+
default="experiments/cityscapes/ddrnet23_slim.yaml",
3939
type=str)
4040
parser.add_argument('opts',
4141
help="Modify config options using the command-line",

0 commit comments

Comments
 (0)