Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs] Replace markdownlint with mdformat and configure myst-parser #493

Closed
wants to merge 10 commits into from
Closed
3 changes: 0 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ jobs:
- run:
name: Install pre-commit hook
command: |
sudo apt-add-repository ppa:brightbox/ruby-ng -y
sudo apt-get update
sudo apt-get install -y ruby2.7
pip install pre-commit
pre-commit install
- run:
Expand Down
30 changes: 15 additions & 15 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ appearance, race, religion, or sexual identity and orientation.
Examples of behavior that contributes to creating a positive environment
include:

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

Examples of unacceptable behavior by participants include:

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

## Our Responsibilities

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

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq

[homepage]: https://www.contributor-covenant.org
6 changes: 2 additions & 4 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

Thanks for your bug report. We appreciate it a lot.
Expand All @@ -29,13 +28,12 @@ A placeholder for the command.

2. Did you make any modifications on the code or config? Did you understand what you have modified?


**Environment**

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

**Error traceback**

Expand Down
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Describe the feature**

**Motivation**

A clear and concise description of the motivation of the feature.
Ex1. It is inconvenient when [....].
Ex1. It is inconvenient when \[....\].

**Related resources**

Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/general_questions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ about: Ask general questions to get help
title: ''
labels: ''
assignees: ''

---
4 changes: 0 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ jobs:
python-version: 3.7
- name: Install pre-commit hook
run: |
# markdownlint requires ruby >= 2.7
sudo apt-add-repository ppa:brightbox/ruby-ng -y
sudo apt-get update
sudo apt-get install -y ruby2.7
pip install pre-commit
pre-commit install
- name: Linting
Expand Down
22 changes: 10 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repos:
hooks:
- id: yapf
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.2.0
hooks:
- id: trailing-whitespace
- id: check-yaml
Expand All @@ -24,17 +24,15 @@ repos:
args: ["--remove"]
- id: mixed-line-ending
args: ["--fix=lf"]
- repo: https://github.com/markdownlint/markdownlint
rev: v0.11.0
hooks:
- id: markdownlint
args:
[
"-r",
"~MD002,~MD013,~MD029,~MD033,~MD034",
"-t",
"allow_different_nesting",
]
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.9
hooks:
- id: mdformat
args: ["--number"]
additional_dependencies:
- mdformat-openmmlab
- mdformat_frontmatter
- linkify-it-py
- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
hooks:
Expand Down
56 changes: 27 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
[![issue resolution](https://img.shields.io/github/issues-closed-raw/open-mmlab/mmdeploy)](https://github.com/open-mmlab/mmdeploy/issues)
[![open issues](https://img.shields.io/github/issues-raw/open-mmlab/mmdeploy)](https://github.com/open-mmlab/mmdeploy/issues)


English | [简体中文](README_zh-CN.md)

## Introduction
Expand All @@ -37,30 +36,28 @@ MMDeploy is an open-source deep learning model deployment toolset. It is a part
<img src="resources/introduction.png">
</div>


## Main features

### Fully support OpenMMLab models

The currently supported codebases and models are as follows, and more will be included in the future
- [mmcls](docs/en/04-supported-codebases/mmcls.md)
- [mmdet](docs/en/04-supported-codebases/mmdet.md)
- [mmseg](docs/en/04-supported-codebases/mmseg.md)
- [mmedit](docs/en/04-supported-codebases/mmedit.md)
- [mmocr](docs/en/04-supported-codebases/mmocr.md)
- [mmpose](docs/en/04-supported-codebases/mmpose.md)
- [mmdet3d](docs/en/04-supported-codebases/mmdet3d.md)
- [mmrotate](docs/en/04-supported-codebases/mmrotate.md)

- [mmcls](docs/en/04-supported-codebases/mmcls.md)
- [mmdet](docs/en/04-supported-codebases/mmdet.md)
- [mmseg](docs/en/04-supported-codebases/mmseg.md)
- [mmedit](docs/en/04-supported-codebases/mmedit.md)
- [mmocr](docs/en/04-supported-codebases/mmocr.md)
- [mmpose](docs/en/04-supported-codebases/mmpose.md)
- [mmdet3d](docs/en/04-supported-codebases/mmdet3d.md)
- [mmrotate](docs/en/04-supported-codebases/mmrotate.md)

### Multiple inference backends are available

Models can be exported and run in the following backends, and more will be compatible

| ONNX Runtime | TensorRT | ppl.nn | ncnn | OpenVINO | LibTorch | more |
| ------------ | -------- | ------ | ---- | -------- | -------- | ---------------------------------------------- |
| ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | [benchmark](docs/en/03-benchmark/benchmark.md) |


| ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | [benchmark](docs/en/03-benchmark/benchmark.md) |

### Efficient and scalable C/C++ SDK Framework

Expand All @@ -70,22 +67,22 @@ All kinds of modules in the SDK can be extended, such as `Transform` for image p

Please read [getting_started.md](docs/en/get_started.md) for the basic usage of MMDeploy. We also provide tutoials about:

* [Build](docs/en/01-how-to-build/build_from_source.md)
* [Build from Docker](docs/en/01-how-to-build/build_from_docker.md)
* [Build for Linux](docs/en/01-how-to-build/linux-x86_64.md)
* [Build for Win10](docs/en/01-how-to-build/windows.md)
* [Build for Android](docs/en/01-how-to-build/android.md)
* [Build for Jetson](docs/en/01-how-to-build/jetsons.md)
* User Guide
* [How to convert model](docs/en/02-how-to-run/convert_model.md)
* [How to write config](docs/en/02-how-to-run/write_config.md)
* [How to evaluate deployed models](docs/en/02-how-to-run/how_to_evaluate_a_model.md)
* [How to measure performance of deployed models](docs/en/02-how-to-run/how_to_measure_performance_of_models.md)
* Developer Guide
* [How to support new models](docs/en/06-developer-guide/support_new_model.md)
* [How to support new backends](docs/en/06-developer-guide/support_new_backend.md)
* [FAQ](docs/en/faq.md)
* [Contributing](.github/CONTRIBUTING.md)
- [Build](docs/en/01-how-to-build/build_from_source.md)
- [Build from Docker](docs/en/01-how-to-build/build_from_docker.md)
- [Build for Linux](docs/en/01-how-to-build/linux-x86_64.md)
- [Build for Win10](docs/en/01-how-to-build/windows.md)
- [Build for Android](docs/en/01-how-to-build/android.md)
- [Build for Jetson](docs/en/01-how-to-build/jetsons.md)
- User Guide
- [How to convert model](docs/en/02-how-to-run/convert_model.md)
- [How to write config](docs/en/02-how-to-run/write_config.md)
- [How to evaluate deployed models](docs/en/02-how-to-run/how_to_evaluate_a_model.md)
- [How to measure performance of deployed models](docs/en/02-how-to-run/how_to_measure_performance_of_models.md)
- Developer Guide
- [How to support new models](docs/en/06-developer-guide/support_new_model.md)
- [How to support new backends](docs/en/06-developer-guide/support_new_backend.md)
- [FAQ](docs/en/faq.md)
- [Contributing](.github/CONTRIBUTING.md)

## Benchmark and Model zoo

Expand All @@ -98,6 +95,7 @@ We appreciate all contributions to MMDeploy. Please refer to [CONTRIBUTING.md](.
## Acknowledgement

We would like to sincerely thank the following teams for their contributions to [MMDeploy](https://github.com/open-mmlab/mmdeploy):

- [OpenPPL](https://github.com/openppl-public)
- [OpenVINO](https://github.com/openvinotoolkit/openvino)
- [ncnn](https://github.com/Tencent/ncnn)
Expand Down
45 changes: 25 additions & 20 deletions README_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ MMDeploy 是 [OpenMMLab](https://openmmlab.com/) 模型部署工具箱,**为
## 特性简介

### 支持超多 OpenMMLab 算法库

- [mmcls](docs/en/04-supported-codebases/mmcls.md)
- [mmdet](docs/en/04-supported-codebases/mmdet.md)
- [mmseg](docs/en/04-supported-codebases/mmseg.md)
Expand All @@ -51,38 +52,41 @@ MMDeploy 是 [OpenMMLab](https://openmmlab.com/) 模型部署工具箱,**为
- [mmrotate](docs/en/04-supported-codebases/mmrotate.md)

### 支持多种推理后端

| ONNX Runtime | TensorRT | ppl.nn | ncnn | OpenVINO | more |
| ------------ | -------- | ------ | ---- | -------- | ------------------------------------------------- |
| ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | [benchmark](docs/zh_cn/03-benchmark/benchmark.md) |
| ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | [benchmark](docs/zh_cn/03-benchmark/benchmark.md) |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @zhouzaida mdformat adjusts this table by mistake.


### SDK 可高度定制化

- Transform 数据预处理
- Net 推理
- Module 后处理

## [快速上手](docs/zh_cn/get_started.md)

* [编译](docs/zh_cn/01-how-to-build/build_from_source.md)
* [Build from Docker](docs/zh_cn/01-how-to-build/build_from_docker.md)
* [Build for Linux](docs/zh_cn/01-how-to-build/linux-x86_64.md)
* [Build for Win10](docs/zh_cn/01-how-to-build/windows.md)
* [Build for Android](docs/zh_cn/01-how-to-build/android.md)
* [Build for Jetson](docs/en/01-how-to-build/jetsons.md)
* 使用
* [把模型转换到推理 Backend](docs/zh_cn/02-how-to-run/convert_model.md)
* [配置转换参数](docs/zh_cn/02-how-to-run/write_config.md)
* [量化](docs/zh_cn/02-how-to-run/quantize_model.md)
* [测试转换完成的模型](docs/zh_cn/02-how-to-run/profile_model.md)
* 开发指南
* [支持新模型](docs/zh_cn/04-developer-guide/support_new_model.md)
* [增加推理 Backend](docs/zh_cn/04-developer-guide/support_new_backend.md)
* [回归测试](docs/zh_cn/04-developer-guide/do_regression_test.md)
* [FAQ](docs/zh_cn/faq.md)
* [贡献者手册](.github/CONTRIBUTING.md)
- [编译](docs/zh_cn/01-how-to-build/build_from_source.md)
- [Build from Docker](docs/zh_cn/01-how-to-build/build_from_docker.md)
- [Build for Linux](docs/zh_cn/01-how-to-build/linux-x86_64.md)
- [Build for Win10](docs/zh_cn/01-how-to-build/windows.md)
- [Build for Android](docs/zh_cn/01-how-to-build/android.md)
- [Build for Jetson](docs/en/01-how-to-build/jetsons.md)
- 使用
- [把模型转换到推理 Backend](docs/zh_cn/02-how-to-run/convert_model.md)
- [配置转换参数](docs/zh_cn/02-how-to-run/write_config.md)
- [量化](docs/zh_cn/02-how-to-run/quantize_model.md)
- [测试转换完成的模型](docs/zh_cn/02-how-to-run/profile_model.md)
- 开发指南
- [支持新模型](docs/zh_cn/04-developer-guide/support_new_model.md)
- [增加推理 Backend](docs/zh_cn/04-developer-guide/support_new_backend.md)
- [回归测试](docs/zh_cn/04-developer-guide/do_regression_test.md)
- [FAQ](docs/zh_cn/faq.md)
- [贡献者手册](.github/CONTRIBUTING.md)

## 新人解说
* [01 术语解释、加载第一个模型](docs/zh_cn/05-tutorial/01_introduction_to_model_deployment.md)
* [02 转成 onnx](docs/zh_cn/05-tutorial/02_challenges.md)

- [01 术语解释、加载第一个模型](docs/zh_cn/05-tutorial/01_introduction_to_model_deployment.md)
- [02 转成 onnx](docs/zh_cn/05-tutorial/02_challenges.md)

## 基准与模型库

Expand All @@ -93,6 +97,7 @@ MMDeploy 是 [OpenMMLab](https://openmmlab.com/) 模型部署工具箱,**为
我们感谢所有的贡献者为改进和提升 MMDeploy 所作出的努力。请参考[贡献指南](.github/CONTRIBUTING.md)来了解参与项目贡献的相关指引。

## 致谢

- [OpenPPL](https://github.com/openppl-public/ppl.nn): 高性能推理框架底层库
- [OpenVINO](https://github.com/openvinotoolkit/openvino): AI 推理优化和部署框架
- [ncnn](https://github.com/tencent/ncnn): 为手机端极致优化的高性能神经网络前向计算框架
Expand Down
15 changes: 8 additions & 7 deletions csrc/mmdeploy/apis/csharp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ We provide nuget package on our [release page](https://github.com/open-mmlab/mmd

To use the nuget package, you also need to download the backend dependencies. For example, if you want to use the tensorrt backend, you should install cudatoolkit, cudnn and tensorrt, remember to add the dll directories to your system path. The version of backend dependencies that our prebuit nuget package used will be offered in release note.

| backend | dependencies |
| ------------- | ------------- |
| tensorrt | cudatoolkit, cudnn, tensorrt |
| onnxruntime | onnxruntime / onnxruntime-gpu |
| backend | dependencies |
| ----------- | ----------------------------- |
| tensorrt | cudatoolkit, cudnn, tensorrt |
| onnxruntime | onnxruntime / onnxruntime-gpu |

## From Source

### Requirements

* Environment required by building sdk
* .NET Framework 4.8 / .NET core 3.1
* Visual Studio 2019+
- Environment required by building sdk
- .NET Framework 4.8 / .NET core 3.1
- Visual Studio 2019+

### Installation

Expand All @@ -34,6 +34,7 @@ There are two methods to build the nuget package.
(*option 1*) Use the command.

If your environment is well prepared, you can just go to the `csrc\apis\csharp` folder, open a terminal and type the following command, the nupkg will be built in `csrc\apis\csharp\MMDeploy\bin\Release\MMDeploy.1.0.0.nupkg`.

```shell
dotnet build --configuration Release -p:Version=1.0.0
```
Expand Down
11 changes: 8 additions & 3 deletions demo/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
## Demo

We provide a demo showing what our mmdeploy can do for general model deployment.

In `demo_rewrite.py`, a resnet18 model from `torchvision` is rewritten through mmdeploy tool. In our rewritten model, the forward function of resnet gets modified to only down sample the original input to 4x. Original onnx model of resnet18 and its rewritten are visualized through [netron](https://netron.app/).

### Prerequisite

Before we run `demp_rewrite.py`, we need to install `pyppeteer` through:

```
pip install pyppeteer
```

### Demo results

The original resnet18 model and its modified one are visualized as follows. The left model is the original resnet18 while the right model is exported after rewritten.
Original resnet18 | Rewritten model
:-------------------------:|:-------------------------:
![](resources/original.png) | ![](resources/rewritten.png)

| Original resnet18 | Rewritten model |
| :-------------------------: | :--------------------------: |
| ![](resources/original.png) | ![](resources/rewritten.png) |
Loading