Skip to content

Commit 0264de0

Browse files
authored
[Improvement] Add markdown linter and fix linting errors (open-mmlab#171)
* [Improvement] Add markdown linter and fix linting errors * fixed pip
1 parent 118fd9d commit 0264de0

39 files changed

+228
-94
lines changed

.github/CONTRIBUTING.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,19 @@ All kinds of contributions are welcome, including but not limited to the followi
1313
4. create a PR
1414

1515
Note
16+
1617
- If you plan to add some new features that involve large changes, it is encouraged to open an issue for discussion first.
1718
- If you are the author of some papers and would like to include your method to mmsegmentation,
18-
please contact Kai Chen (chenkaidev[at]gmail[dot]com). We will much appreciate your contribution.
19+
please contact Kai Chen (chenkaidev[at]gmail[dot]com). We will much appreciate your contribution.
1920

2021
## Code style
2122

2223
### Python
24+
2325
We adopt [PEP8](https://www.python.org/dev/peps/pep-0008/) as the preferred code style.
2426

2527
We use the following tools for linting and formatting:
28+
2629
- [flake8](http://flake8.pycqa.org/en/latest/): linter
2730
- [yapf](https://github.com/google/yapf): formatter
2831
- [isort](https://github.com/timothycrosley/isort): sort imports
@@ -35,19 +38,20 @@ The config for a pre-commit hook is stored in [.pre-commit-config](../.pre-commi
3538

3639
After you clone the repository, you will need to install initialize pre-commit hook.
3740

38-
```
41+
```shell
3942
pip install -U pre-commit
4043
```
4144

4245
From the repository folder
43-
```
46+
47+
```shell
4448
pre-commit install
4549
```
4650

4751
After this on every commit check code linters and formatter will be enforced.
4852

49-
5053
>Before you create a PR, make sure that your code lints and is formatted by yapf.
5154
5255
### C++ and CUDA
56+
5357
We follow the [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html).

.github/ISSUE_TEMPLATE/error-report.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,21 @@ assignees: ''
1010
Thanks for your error report and we appreciate it a lot.
1111

1212
**Checklist**
13+
1314
1. I have searched related issues but cannot get the expected help.
1415
2. The bug has not been fixed in the latest version.
1516

1617
**Describe the bug**
1718
A clear and concise description of what the bug is.
1819

1920
**Reproduction**
21+
2022
1. What command or script did you run?
21-
```
22-
A placeholder for the command.
23-
```
23+
24+
```none
25+
A placeholder for the command.
26+
```
27+
2428
2. Did you make any modifications on the code or config? Did you understand what you have modified?
2529
3. What dataset did you use?
2630
@@ -32,10 +36,13 @@ A placeholder for the command.
3236
- Other environment variables that may be related (such as `$PATH`, `$LD_LIBRARY_PATH`, `$PYTHONPATH`, etc.)
3337
3438
**Error traceback**
39+
3540
If applicable, paste the error trackback here.
36-
```
41+
42+
```none
3743
A placeholder for trackback.
3844
```
3945

4046
**Bug fix**
47+
4148
If you have already identified the reason, you can provide the information here. If you are willing to create a PR to fix it, please also leave a comment here and that would be much appreciated!

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ assignees: ''
77

88
---
99

10-
**Describe the feature**
10+
# Describe the feature
1111

1212
**Motivation**
1313
A clear and concise description of the motivation of the feature.

.github/workflows/build.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,16 @@ jobs:
1111
uses: actions/setup-python@v1
1212
with:
1313
python-version: 3.7
14-
- name: Install linting dependencies
14+
- name: Install pre-commit hook
1515
run: |
16-
python -m pip install --upgrade pip
17-
pip install flake8 isort==4.3.21 yapf interrogate
18-
- name: Lint with flake8
19-
run: flake8 .
20-
- name: Lint with isort
21-
run: isort --recursive --check-only --diff mmseg/ tests/ examples/
22-
- name: Format python codes with yapf
23-
run: yapf -r -d mmseg/ tests/ examples/
16+
pip install pre-commit
17+
pre-commit install
18+
- name: Linting
19+
run: pre-commit run --all-files
2420
- name: Check docstring
25-
run: interrogate -v --ignore-init-method --ignore-module --ignore-nested-functions --exclude mmseg/ops --ignore-regex "__repr__" --fail-under 80 mmseg
21+
run: |
22+
pip install interrogate
23+
interrogate -v --ignore-init-method --ignore-module --ignore-nested-functions --exclude mmseg/ops --ignore-regex "__repr__" --fail-under 80 mmseg
2624
2725
build:
2826
env:

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ repos:
2828
args: ["--remove"]
2929
- id: mixed-line-ending
3030
args: ["--fix=lf"]
31+
- repo: https://github.com/jumanjihouse/pre-commit-hooks
32+
rev: 2.1.4
33+
hooks:
34+
- id: markdownlint
35+
args: ["-r", "~MD002,~MD013,~MD029,~MD033,~MD034,~MD036"]
3136
- repo: https://github.com/myint/docformatter
3237
rev: v1.3.1
3338
hooks:

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,15 @@ Please refer to [changelog.md](docs/changelog.md) for details and release histor
5454
Results and models are available in the [model zoo](docs/model_zoo.md).
5555

5656
Supported backbones:
57+
5758
- [x] ResNet
5859
- [x] ResNeXt
5960
- [x] [HRNet](configs/hrnet/README.md)
6061
- [x] [ResNeSt](configs/resnest/README.md)
6162
- [x] [MobileNetV2](configs/mobilenet_v2/README.md)
6263

6364
Supported methods:
65+
6466
- [x] [FCN](configs/fcn)
6567
- [x] [PSPNet](configs/pspnet)
6668
- [x] [DeepLabV3](configs/deeplabv3)

configs/ann/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Asymmetric Non-local Neural Networks for Semantic Segmentation
22

33
## Introduction
4-
```
4+
5+
```latex
56
@inproceedings{annn,
67
author = {Zhen Zhu and
78
Mengde Xu and
@@ -18,6 +19,7 @@
1819
## Results and models
1920

2021
### Cityscapes
22+
2123
| Method | Backbone | Crop Size | Lr schd | Mem (GB) | Inf time (fps) | mIoU | mIoU(ms+flip) | download |
2224
|--------|----------|-----------|--------:|----------|----------------|------:|--------------:|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
2325
| ANN | R-50-D8 | 512x1024 | 40000 | 6 | 3.71 | 77.40 | 78.57 | [model](https://download.openmmlab.com/mmsegmentation/v0.5/ann/ann_r50-d8_512x1024_40k_cityscapes/ann_r50-d8_512x1024_40k_cityscapes_20200605_095211-049fc292.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/ann/ann_r50-d8_512x1024_40k_cityscapes/ann_r50-d8_512x1024_40k_cityscapes_20200605_095211.log.json) |
@@ -30,6 +32,7 @@
3032
| ANN | R-101-D8 | 769x769 | 80000 | - | - | 78.80 | 80.34 | [model](https://download.openmmlab.com/mmsegmentation/v0.5/ann/ann_r101-d8_769x769_80k_cityscapes/ann_r101-d8_769x769_80k_cityscapes_20200607_013713-a9d4be8d.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/ann/ann_r101-d8_769x769_80k_cityscapes/ann_r101-d8_769x769_80k_cityscapes_20200607_013713.log.json) |
3133

3234
### ADE20K
35+
3336
| Method | Backbone | Crop Size | Lr schd | Mem (GB) | Inf time (fps) | mIoU | mIoU(ms+flip) | download |
3437
|--------|----------|-----------|--------:|----------|----------------|------:|--------------:|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
3538
| ANN | R-50-D8 | 512x512 | 80000 | 9.1 | 21.01 | 41.01 | 42.30 | [model](https://download.openmmlab.com/mmsegmentation/v0.5/ann/ann_r50-d8_512x512_80k_ade20k/ann_r50-d8_512x512_80k_ade20k_20200615_014818-26f75e11.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/ann/ann_r50-d8_512x512_80k_ade20k/ann_r50-d8_512x512_80k_ade20k_20200615_014818.log.json) |
@@ -38,6 +41,7 @@
3841
| ANN | R-101-D8 | 512x512 | 160000 | - | - | 42.94 | 44.06 | [model](https://download.openmmlab.com/mmsegmentation/v0.5/ann/ann_r101-d8_512x512_160k_ade20k/ann_r101-d8_512x512_160k_ade20k_20200615_231733-955eb1ec.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/ann/ann_r101-d8_512x512_160k_ade20k/ann_r101-d8_512x512_160k_ade20k_20200615_231733.log.json) |
3942

4043
### Pascal VOC 2012 + Aug
44+
4145
| Method | Backbone | Crop Size | Lr schd | Mem (GB) | Inf time (fps) | mIoU | mIoU(ms+flip) | download |
4246
|--------|----------|-----------|--------:|----------|----------------|------:|--------------:|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
4347
| ANN | R-50-D8 | 512x512 | 20000 | 6 | 20.92 | 74.86 | 76.13 | [model](https://download.openmmlab.com/mmsegmentation/v0.5/ann/ann_r50-d8_512x512_20k_voc12aug/ann_r50-d8_512x512_20k_voc12aug_20200617_222246-dfcb1c62.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/ann/ann_r50-d8_512x512_20k_voc12aug/ann_r50-d8_512x512_20k_voc12aug_20200617_222246.log.json) |

configs/ccnet/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# CCNet: Criss-Cross Attention for Semantic Segmentation
22

33
## Introduction
4-
```
4+
5+
```latex
56
@article{huang2018ccnet,
67
title={CCNet: Criss-Cross Attention for Semantic Segmentation},
78
author={Huang, Zilong and Wang, Xinggang and Huang, Lichao and Huang, Chang and Wei, Yunchao and Liu, Wenyu},
@@ -13,6 +14,7 @@
1314
## Results and models
1415

1516
### Cityscapes
17+
1618
| Method | Backbone | Crop Size | Lr schd | Mem (GB) | Inf time (fps) | mIoU | mIoU(ms+flip) | download |
1719
|--------|----------|-----------|--------:|----------|----------------|------:|--------------:|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
1820
| CCNet | R-50-D8 | 512x1024 | 40000 | 6 | 3.32 | 77.76 | 78.87 | [model](https://download.openmmlab.com/mmsegmentation/v0.5/ccnet/ccnet_r50-d8_512x1024_40k_cityscapes/ccnet_r50-d8_512x1024_40k_cityscapes_20200616_142517-4123f401.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/ccnet/ccnet_r50-d8_512x1024_40k_cityscapes/ccnet_r50-d8_512x1024_40k_cityscapes_20200616_142517.log.json) |
@@ -25,6 +27,7 @@
2527
| CCNet | R-101-D8 | 769x769 | 80000 | - | - | 79.45 | 80.66 | [model](https://download.openmmlab.com/mmsegmentation/v0.5/ccnet/ccnet_r101-d8_769x769_80k_cityscapes/ccnet_r101-d8_769x769_80k_cityscapes_20200618_011502-ad3cd481.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/ccnet/ccnet_r101-d8_769x769_80k_cityscapes/ccnet_r101-d8_769x769_80k_cityscapes_20200618_011502.log.json) |
2628

2729
### ADE20K
30+
2831
| Method | Backbone | Crop Size | Lr schd | Mem (GB) | Inf time (fps) | mIoU | mIoU(ms+flip) | download |
2932
|--------|----------|-----------|--------:|----------|----------------|------:|--------------:|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
3033
| CCNet | R-50-D8 | 512x512 | 80000 | 8.8 | 20.89 | 41.78 | 42.98 | [model](https://download.openmmlab.com/mmsegmentation/v0.5/ccnet/ccnet_r50-d8_512x512_80k_ade20k/ccnet_r50-d8_512x512_80k_ade20k_20200615_014848-aa37f61e.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/ccnet/ccnet_r50-d8_512x512_80k_ade20k/ccnet_r50-d8_512x512_80k_ade20k_20200615_014848.log.json) |
@@ -33,6 +36,7 @@
3336
| CCNet | R-101-D8 | 512x512 | 160000 | - | - | 43.71 | 45.04 | [model](https://download.openmmlab.com/mmsegmentation/v0.5/ccnet/ccnet_r101-d8_512x512_160k_ade20k/ccnet_r101-d8_512x512_160k_ade20k_20200616_000644-e849e007.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/ccnet/ccnet_r101-d8_512x512_160k_ade20k/ccnet_r101-d8_512x512_160k_ade20k_20200616_000644.log.json) |
3437

3538
### Pascal VOC 2012 + Aug
39+
3640
| Method | Backbone | Crop Size | Lr schd | Mem (GB) | Inf time (fps) | mIoU | mIoU(ms+flip) | download |
3741
|--------|----------|-----------|--------:|----------|----------------|------:|--------------:|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
3842
| CCNet | R-50-D8 | 512x512 | 20000 | 6 | 20.45 | 76.17 | 77.51 | [model](https://download.openmmlab.com/mmsegmentation/v0.5/ccnet/ccnet_r50-d8_512x512_20k_voc12aug/ccnet_r50-d8_512x512_20k_voc12aug_20200617_193212-fad81784.pth) | [log](https://download.openmmlab.com/mmsegmentation/v0.5/ccnet/ccnet_r50-d8_512x512_20k_voc12aug/ccnet_r50-d8_512x512_20k_voc12aug_20200617_193212.log.json) |

0 commit comments

Comments
 (0)