Skip to content

Commit 28efead

Browse files
authored
[Docs] Replace markdownlint with mdformat for avoiding installing ruby (open-mmlab#1591)
* [Docs] Replace markdownlint with mdformat for avoiding installing ruby * [Docs] Replace markdownlint with mdformat for avoiding installing ruby * lint
1 parent c0e0f95 commit 28efead

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+1474
-1428
lines changed

Diff for: .dev/log_collector/readme.md

+8-7
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ markdown_file ='markdowns/lr_in_trans.json.md'
4343
json_file = 'jsons/trans_in_cnn.json'
4444
```
4545

46-
The structure of the work-dir directory should be like:
46+
The structure of the work-dir directory should be like:
4747

4848
```text
4949
├── work-dir
@@ -69,14 +69,15 @@ python log_collector.py ./example_config.py
6969

7070
The output markdown file is like:
7171

72-
|exp_num|method|mIoU best|best index|mIoU last|last index|last iter num|
73-
|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
74-
|1|segformer_mit-b5_512x512_160k_ade20k_cnn_lr_with_warmup|0.2776|10|0.2776|10|160000|
75-
|2|segformer_mit-b5_512x512_160k_ade20k_cnn_no_warmup_lr|0.2802|10|0.2802|10|160000|
76-
|3|segformer_mit-b5_512x512_160k_ade20k_mit_trans_lr|0.4943|11|0.4943|11|160000|
77-
|4|segformer_mit-b5_512x512_160k_ade20k_swin_trans_lr|0.4883|11|0.4883|11|160000|
72+
| exp_num | method | mIoU best | best index | mIoU last | last index | last iter num |
73+
| :-----: | :-----------------------------------------------------: | :-------: | :--------: | :-------: | :--------: | :-----------: |
74+
| 1 | segformer_mit-b5_512x512_160k_ade20k_cnn_lr_with_warmup | 0.2776 | 10 | 0.2776 | 10 | 160000 |
75+
| 2 | segformer_mit-b5_512x512_160k_ade20k_cnn_no_warmup_lr | 0.2802 | 10 | 0.2802 | 10 | 160000 |
76+
| 3 | segformer_mit-b5_512x512_160k_ade20k_mit_trans_lr | 0.4943 | 11 | 0.4943 | 11 | 160000 |
77+
| 4 | segformer_mit-b5_512x512_160k_ade20k_swin_trans_lr | 0.4883 | 11 | 0.4883 | 11 | 160000 |
7878

7979
The output json file is like:
80+
8081
```json
8182
[
8283
{

Diff for: .dev/md2yml.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,11 @@ def parse_md(md_file):
127127
elif line[:15] == '<!-- [BACKBONE]':
128128
is_backbone = True
129129
i += 1
130-
elif line[0] == '|' and (
131-
i + 1) < len(lines) and lines[i + 1][:3] == '| -':
130+
elif (line[0] == '|' and (i + 1) < len(lines)
131+
and lines[i + 1][:3] == '| -' and 'Method' in line
132+
and 'Crop Size' in line and 'Mem (GB)' in line):
132133
cols = [col.strip() for col in line.split('|')]
134+
print(cols)
133135
method_id = cols.index('Method')
134136
backbone_id = cols.index('Backbone')
135137
crop_size_id = cols.index('Crop Size')

Diff for: .github/CODE_OF_CONDUCT.md

+15-15
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@ appearance, race, religion, or sexual identity and orientation.
1414
Examples of behavior that contributes to creating a positive environment
1515
include:
1616

17-
* Using welcoming and inclusive language
18-
* Being respectful of differing viewpoints and experiences
19-
* Gracefully accepting constructive criticism
20-
* Focusing on what is best for the community
21-
* Showing empathy towards other community members
17+
- Using welcoming and inclusive language
18+
- Being respectful of differing viewpoints and experiences
19+
- Gracefully accepting constructive criticism
20+
- Focusing on what is best for the community
21+
- Showing empathy towards other community members
2222

2323
Examples of unacceptable behavior by participants include:
2424

25-
* The use of sexualized language or imagery and unwelcome sexual attention or
26-
advances
27-
* Trolling, insulting/derogatory comments, and personal or political attacks
28-
* Public or private harassment
29-
* Publishing others' private information, such as a physical or electronic
30-
address, without explicit permission
31-
* Other conduct which could reasonably be considered inappropriate in a
32-
professional setting
25+
- The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
- Trolling, insulting/derogatory comments, and personal or political attacks
28+
- Public or private harassment
29+
- Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
- Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
3333

3434
## Our Responsibilities
3535

@@ -70,7 +70,7 @@ members of the project's leadership.
7070
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
7171
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
7272

73-
[homepage]: https://www.contributor-covenant.org
74-
7573
For answers to common questions about this code of conduct, see
7674
https://www.contributor-covenant.org/faq
75+
76+
[homepage]: https://www.contributor-covenant.org

Diff for: .github/CONTRIBUTING.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ All kinds of contributions are welcome, including but not limited to the followi
1616

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

2222
## Code style
2323

@@ -34,7 +34,7 @@ We use the following tools for linting and formatting:
3434
Style configurations of yapf and isort can be found in [setup.cfg](../setup.cfg) and [.isort.cfg](../.isort.cfg).
3535

3636
We use [pre-commit hook](https://pre-commit.com/) that checks and formats for `flake8`, `yapf`, `isort`, `trailing whitespaces`,
37-
fixes `end-of-files`, sorts `requirments.txt` automatically on every commit.
37+
fixes `end-of-files`, sorts `requirments.txt` automatically on every commit.
3838
The config for a pre-commit hook is stored in [.pre-commit-config](../.pre-commit-config.yaml).
3939

4040
After you clone the repository, you will need to install initialize pre-commit hook.
@@ -51,7 +51,7 @@ pre-commit install
5151

5252
After this on every commit check code linters and formatter will be enforced.
5353

54-
>Before you create a PR, make sure that your code lints and is formatted by yapf.
54+
> Before you create a PR, make sure that your code lints and is formatted by yapf.
5555
5656
### C++ and CUDA
5757

Diff for: .github/ISSUE_TEMPLATE/error-report.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ about: Create a report to help us improve
44
title: ''
55
labels: ''
66
assignees: ''
7-
87
---
98

109
Thanks for your error report and we appreciate it a lot.
@@ -21,19 +20,20 @@ A clear and concise description of what the bug is.
2120

2221
1. What command or script did you run?
2322

24-
```none
25-
A placeholder for the command.
26-
```
23+
```none
24+
A placeholder for the command.
25+
```
2726

2827
2. Did you make any modifications on the code or config? Did you understand what you have modified?
28+
2929
3. What dataset did you use?
3030

3131
**Environment**
3232

3333
1. Please run `python mmseg/utils/collect_env.py` to collect necessary environment information and paste it here.
3434
2. You may add addition that may be helpful for locating the problem, such as
35-
- How you installed PyTorch [e.g., pip, conda, source]
36-
- Other environment variables that may be related (such as `$PATH`, `$LD_LIBRARY_PATH`, `$PYTHONPATH`, etc.)
35+
- How you installed PyTorch \[e.g., pip, conda, source\]
36+
- Other environment variables that may be related (such as `$PATH`, `$LD_LIBRARY_PATH`, `$PYTHONPATH`, etc.)
3737

3838
**Error traceback**
3939

Diff for: .github/ISSUE_TEMPLATE/feature_request.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@ about: Suggest an idea for this project
44
title: ''
55
labels: ''
66
assignees: ''
7-
87
---
98

109
# Describe the feature
1110

1211
**Motivation**
1312
A clear and concise description of the motivation of the feature.
14-
Ex1. It is inconvenient when [....].
15-
Ex2. There is a recent paper [....], which is very helpful for [....].
13+
Ex1. It is inconvenient when \[....\].
14+
Ex2. There is a recent paper \[....\], which is very helpful for \[....\].
1615

1716
**Related resources**
1817
If there is an official code release or third-party implementations, please also provide the information here, which would be very helpful.

Diff for: .github/ISSUE_TEMPLATE/general_questions.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ about: Ask general questions to get help
44
title: ''
55
labels: ''
66
assignees: ''
7-
87
---

Diff for: .github/ISSUE_TEMPLATE/reimplementation_questions.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
name: Reimplementation Questions
33
about: Ask about questions during model reimplementation
44
title: ''
5-
labels: 'reimplementation'
5+
labels: reimplementation
66
assignees: ''
7-
87
---
98

109
If you feel we have helped you, give us a STAR! :satisfied:
@@ -54,7 +53,7 @@ A placeholder for the config.
5453

5554
1. Please run `PYTHONPATH=${PWD}:$PYTHONPATH python mmseg/utils/collect_env.py` to collect the necessary environment information and paste it here.
5655
2. You may add an addition that may be helpful for locating the problem, such as
57-
1. How you installed PyTorch [e.g., pip, conda, source]
56+
1. How you installed PyTorch \[e.g., pip, conda, source\]
5857
2. Other environment variables that may be related (such as `$PATH`, `$LD_LIBRARY_PATH`, `$PYTHONPATH`, etc.)
5958

6059
**Results**

Diff for: .pre-commit-config.yaml

+9-6
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,15 @@ repos:
2424
args: ["--remove"]
2525
- id: mixed-line-ending
2626
args: ["--fix=lf"]
27-
- repo: https://github.com/markdownlint/markdownlint
28-
rev: v0.11.0
29-
hooks:
30-
- id: markdownlint
31-
args: ["-r", "~MD002,~MD013,~MD029,~MD033,~MD034",
32-
"-t", "allow_different_nesting"]
27+
- repo: https://github.com/executablebooks/mdformat
28+
rev: 0.7.14
29+
hooks:
30+
- id: mdformat
31+
args: ["--number"]
32+
additional_dependencies:
33+
- mdformat-gfm
34+
- mdformat_frontmatter
35+
- linkify-it-py
3336
- repo: https://github.com/codespell-project/codespell
3437
rev: v2.1.0
3538
hooks:

Diff for: README_zh-CN.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,13 @@ MMSegmentation 是一个由来自不同高校和企业的研发人员共同参
202202

203203
## 欢迎加入 OpenMMLab 社区
204204

205-
扫描下方的二维码可关注 OpenMMLab 团队的 [知乎官方账号](https://www.zhihu.com/people/openmmlab),加入 [OpenMMLab 团队](https://jq.qq.com/?_wv=1027&k=aCvMxdr3) 以及 [MMSegmentation](https://jq.qq.com/?_wv=1027&k=9sprS2YO) 的 QQ 群。
205+
扫描下方的二维码可关注 OpenMMLab 团队的 [知乎官方账号](https://www.zhihu.com/people/openmmlab),加入 [OpenMMLab 团队](https://jq.qq.com/?_wv=1027&k=aCvMxdr3) 以及 [MMSegmentation](https://jq.qq.com/?_wv=1027&k=9sprS2YO) 的 QQ 群。
206206

207-
<div align="center">
207+
<div align="center">
208208
<img src="docs/zh_cn/imgs/zhihu_qrcode.jpg" height="400" /> <img src="docs/zh_cn/imgs/qq_group_qrcode.jpg" height="400" />
209209
</div>
210210

211-
我们会在 OpenMMLab 社区为大家
211+
我们会在 OpenMMLab 社区为大家
212212

213213
- 📢 分享 AI 框架的前沿核心技术
214214
- 💻 解读 PyTorch 常用模块源码
@@ -217,4 +217,4 @@ MMSegmentation 是一个由来自不同高校和企业的研发人员共同参
217217
- 🏃 获取更高效的问题答疑和意见反馈
218218
- 🔥 提供与各行各业开发者充分交流的平台
219219

220-
干货满满 📘,等你来撩 💗,OpenMMLab 社区期待您的加入 👬
220+
干货满满 📘,等你来撩 💗,OpenMMLab 社区期待您的加入 👬

0 commit comments

Comments
 (0)