diff --git a/docs/en/get_started.md b/docs/en/get_started.md index 9fc4d9b20..579723bc7 100644 --- a/docs/en/get_started.md +++ b/docs/en/get_started.md @@ -27,7 +27,7 @@ Beside the backend models, it also includes the model meta info, which will be u Inference SDK is developed by C/C++, wrapping the preprocessing, model forward and postprocessing modules in model inference. It supports FFI such as C, C++, Python, C#, Java and so on. -## prerequisites +## Prerequisites In order to do an end-to-end model deployment, MMDeploy requires Python 3.6+ and PyTorch 1.5+. diff --git a/docs/en/index.rst b/docs/en/index.rst index 92b933961..dcfb214b6 100644 --- a/docs/en/index.rst +++ b/docs/en/index.rst @@ -20,10 +20,10 @@ You can switch between Chinese and English documents in the lower-left corner of :maxdepth: 1 :caption: Run & Test - 02-how-to-run/how_to_convert_model.md + 02-how-to-run/convert_model.md + 02-how-to-run/write_config.md 02-how-to-run/how_to_evaluate_a_model.md 02-how-to-run/how_to_measure_performance_of_models.md - 02-how-to-run/how_to_write_config.md .. toctree:: :maxdepth: 1 diff --git a/docs/zh_cn/02-how-to-run/convert_model.md b/docs/zh_cn/02-how-to-run/convert_model.md index 090ec5135..8ca64ce7b 100644 --- a/docs/zh_cn/02-how-to-run/convert_model.md +++ b/docs/zh_cn/02-how-to-run/convert_model.md @@ -1,4 +1,4 @@ -## 如何转换模型 +# 如何转换模型 @@ -86,4 +86,4 @@ python ./tools/deploy.py \ ## 各后端已支持导出的模型列表 -参考[已支持的模型列表](https://mmdeploy.readthedocs.io/en/latest/supported_models.html)。 +参考[已支持的模型列表](../03-benchmark/supported_models.md)。 diff --git a/docs/zh_cn/02-how-to-run/quantize_model.md b/docs/zh_cn/02-how-to-run/quantize_model.md index cd3b890d1..3f49c4bcd 100644 --- a/docs/zh_cn/02-how-to-run/quantize_model.md +++ b/docs/zh_cn/02-how-to-run/quantize_model.md @@ -1,4 +1,4 @@ -# 部署量化模型 +# 如何量化模型 ## 为什么要量化 diff --git a/docs/zh_cn/03-benchmark/supported_models.md b/docs/zh_cn/03-benchmark/supported_models.md index 35e6b393f..1773eda11 100644 --- a/docs/zh_cn/03-benchmark/supported_models.md +++ b/docs/zh_cn/03-benchmark/supported_models.md @@ -1,4 +1,4 @@ -## 支持列表 +# 模型支持列表 自测完成的 model-backend 组合: @@ -70,7 +70,7 @@ | CenterPoint (pillar) | MMDetection3d | ? | Y | Y | N | N | Y | [config](https://github.com/open-mmlab/mmdetection3d/blob/master/configs/centerpoint) | | RotatedRetinaNet | RotatedDetection | N | Y | Y | N | N | N | [config](https://github.com/open-mmlab/mmrotate/blob/main/configs/rotated_retinanet/README.md) | -### Note +## Note - Tag: - static: This model only support static export. Please use `static` deploy config, just like $MMDEPLOY_DIR/configs/mmseg/segmentation_tensorrt_static-1024x2048.py. diff --git a/docs/zh_cn/05-tutorial/03_pytorch2onnx.md b/docs/zh_cn/05-tutorial/03_pytorch2onnx.md index b68550d23..972e6cc44 100644 --- a/docs/zh_cn/05-tutorial/03_pytorch2onnx.md +++ b/docs/zh_cn/05-tutorial/03_pytorch2onnx.md @@ -1,3 +1,5 @@ +# 第三章:PyTorch 转 ONNX 详解 + ONNX 是目前模型部署中最重要的中间表示之一。学懂了 ONNX 的技术细节,就能规避大量的模型部署问题。从这篇文章开始,在接下来的三篇文章里,我们将由浅入深地介绍 ONNX 相关的知识。在第一篇文章里,我们会介绍更多 PyTorch 转 ONNX 的细节,让大家完全掌握把简单的 PyTorch 模型转成 ONNX 模型的方法;在第二篇文章里,我们将介绍如何在 PyTorch 中支持更多的 ONNX 算子,让大家能彻底走通 PyTorch 到 ONNX 这条部署路线;第三篇文章里,我们讲介绍 ONNX 本身的知识,以及修改、调试 ONNX 模型的常用方法,使大家能自行解决大部分和 ONNX 有关的部署问题。 在把 PyTorch 模型转换成 ONNX 模型时,我们往往只需要轻松地调用一句`torch.onnx.export`就行了。这个函数的接口看上去简单,但它在使用上还有着诸多的“潜规则”。在这篇教程中,我们会详细介绍 PyTorch 模型转 ONNX 模型的原理及注意事项。除此之外,我们还会介绍 PyTorch 与 ONNX 的算子对应关系,以教会大家如何处理 PyTorch 模型转换时可能会遇到的算子支持问题。 @@ -27,6 +29,7 @@ class Model(torch.nn.Module): return x + models = [Model(2), Model(3)] model_names = ['model_2', 'model_3'] diff --git a/docs/zh_cn/05-tutorial/04_onnx_custom_op.md b/docs/zh_cn/05-tutorial/04_onnx_custom_op.md index f1eba51ae..213f33963 100644 --- a/docs/zh_cn/05-tutorial/04_onnx_custom_op.md +++ b/docs/zh_cn/05-tutorial/04_onnx_custom_op.md @@ -1,4 +1,4 @@ -# 模型部署入门教程(四):在 PyTorch 中支持更多 ONNX 算子 +# 第四章:在 PyTorch 中支持更多 ONNX 算子 在[上一篇教程](03_pytorch2onnx.md)中,我们系统地学习了 PyTorch 转 ONNX 的方法,可以发现 PyTorch 对 ONNX 的支持还不错。但在实际的部署过程中,难免碰到模型无法用原生 PyTorch 算子表示的情况。这个时候,我们就得考虑扩充 PyTorch,即在 PyTorch 中支持更多 ONNX 算子。 diff --git a/docs/zh_cn/05-tutorial/05_onnx_model_editing.md b/docs/zh_cn/05-tutorial/05_onnx_model_editing.md index f7ccf606d..b390703df 100644 --- a/docs/zh_cn/05-tutorial/05_onnx_model_editing.md +++ b/docs/zh_cn/05-tutorial/05_onnx_model_editing.md @@ -1,4 +1,4 @@ -# 模型部署入门教程(五):ONNX 模型的修改与调试 +# 第五章:ONNX 模型的修改与调试 在前两期教程中,我们学习了 PyTorch 模型转 ONNX 模型的方法,了解了如何在原生算子表达能力不足时,为 PyTorch 或 ONNX 自定义算子。一直以来,我们都是通过 PyTorch 来导出 ONNX 模型的,基本没有单独探究过 ONNX 模型的构造知识。 diff --git a/docs/zh_cn/get_started.md b/docs/zh_cn/get_started.md index 2894a5627..d976cc6f6 100644 --- a/docs/zh_cn/get_started.md +++ b/docs/zh_cn/get_started.md @@ -6,7 +6,7 @@ MMDeploy 提供了一系列工具,帮助您更轻松的将 OpenMMLab 下的算 在接下来的章节中,我们将会向您展示 MMDeploy 的模型部署方式。并在 NVIDIA 设备上,以 [MMDetection](https://github.com/open-mmlab/mmdetection) Faster R-CNN 模型为例,演示 MMDeploy 的基本使用方法。 -## 简介 +## 流程简介 MMDeploy 定义的模型部署流程,如下图所示: ![deploy-pipeline](https://user-images.githubusercontent.com/4560679/172306700-31b4c922-2f04-42ed-a1d6-c360f2f3048c.png) diff --git a/docs/zh_cn/index.rst b/docs/zh_cn/index.rst index 134cd5d5b..4c2d629df 100644 --- a/docs/zh_cn/index.rst +++ b/docs/zh_cn/index.rst @@ -3,6 +3,12 @@ 点击页面左下角切换中英文。 +.. toctree:: + :maxdepth: 2 + :caption: 快速上手 + + get_started.md + .. toctree:: :maxdepth: 1 :caption: 编译 @@ -39,7 +45,6 @@ :maxdepth: 1 :caption: 新人解说 - get_started.md 05-tutorial/01_introduction_to_model_deployment.md 05-tutorial/02_challenges.md 05-tutorial/03_pytorch2onnx.md diff --git a/requirements/readthedocs.txt b/requirements/readthedocs.txt index a4517b133..3f71e5da8 100644 --- a/requirements/readthedocs.txt +++ b/requirements/readthedocs.txt @@ -1,4 +1,5 @@ h5py mmcv onnx>=1.8.0 +opencv-python==4.5.4.60 torch