Fix get-started rendering issues in readthedocs (#740)
* fix mermaid markdown rendering issue in readthedocs * fix error in C++ example * fix error in c++ example in zh_cn get_started docpull/754/head
parent
dace58e844
commit
71d085b1a6
|
@ -55,6 +55,7 @@ extensions = [
|
||||||
'sphinx_markdown_tables',
|
'sphinx_markdown_tables',
|
||||||
'myst_parser',
|
'myst_parser',
|
||||||
'sphinx_copybutton',
|
'sphinx_copybutton',
|
||||||
|
'sphinxcontrib.mermaid'
|
||||||
] # yapf: disable
|
] # yapf: disable
|
||||||
|
|
||||||
autodoc_mock_imports = ['tensorrt']
|
autodoc_mock_imports = ['tensorrt']
|
||||||
|
|
|
@ -244,7 +244,7 @@ cv2.imwrite('output_detection.png', img)
|
||||||
You can find more examples from [here](https://github.com/open-mmlab/mmdeploy/tree/master/demo/python).
|
You can find more examples from [here](https://github.com/open-mmlab/mmdeploy/tree/master/demo/python).
|
||||||
|
|
||||||
```{note}
|
```{note}
|
||||||
If you build MMDeploy from the source, please add ${MMDEPLOY_DIR}/build/lib to the environment variable PYTHONPATH.
|
If you build MMDeploy from source, please add ${MMDEPLOY_DIR}/build/lib to the environment variable PYTHONPATH.
|
||||||
Otherwise, you will run into an error like ’ModuleNotFoundError: No module named 'mmdeploy_python'
|
Otherwise, you will run into an error like ’ModuleNotFoundError: No module named 'mmdeploy_python'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -252,7 +252,7 @@ Otherwise, you will run into an error like ’ModuleNotFoundError: No module nam
|
||||||
|
|
||||||
Using SDK C API should follow next pattern,
|
Using SDK C API should follow next pattern,
|
||||||
|
|
||||||
```mermaid
|
```{mermaid}
|
||||||
graph LR
|
graph LR
|
||||||
A[create inference handle] --> B(read image)
|
A[create inference handle] --> B(read image)
|
||||||
B --> C(apply handle)
|
B --> C(apply handle)
|
||||||
|
@ -304,7 +304,7 @@ int main() {
|
||||||
cv::Point{(int)box.right, (int)box.bottom}, cv::Scalar{0, 255, 0});
|
cv::Point{(int)box.right, (int)box.bottom}, cv::Scalar{0, 255, 0});
|
||||||
}
|
}
|
||||||
|
|
||||||
cv::imwrite('output_detection.png', img);
|
cv::imwrite("output_detection.png", img);
|
||||||
|
|
||||||
// destroy result buffer
|
// destroy result buffer
|
||||||
mmdeploy_detector_release_result(bboxes, res_count, 1);
|
mmdeploy_detector_release_result(bboxes, res_count, 1);
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
以 ncnn backend 为例,完整的工作流如下:
|
以 ncnn backend 为例,完整的工作流如下:
|
||||||
|
|
||||||
```mermaid
|
```{mermaid}
|
||||||
flowchart TD;
|
flowchart TD;
|
||||||
torch模型-->非标准onnx;
|
torch模型-->非标准onnx;
|
||||||
非标准onnx-->ncnn-fp32;
|
非标准onnx-->ncnn-fp32;
|
||||||
|
|
|
@ -56,6 +56,7 @@ extensions = [
|
||||||
'sphinx_markdown_tables',
|
'sphinx_markdown_tables',
|
||||||
'myst_parser',
|
'myst_parser',
|
||||||
'sphinx_copybutton',
|
'sphinx_copybutton',
|
||||||
|
'sphinxcontrib.mermaid'
|
||||||
] # yapf: disable
|
] # yapf: disable
|
||||||
|
|
||||||
autodoc_mock_imports = ['tensorrt']
|
autodoc_mock_imports = ['tensorrt']
|
||||||
|
|
|
@ -251,7 +251,7 @@ cv2.imwrite('output_detection.png', img)
|
||||||
|
|
||||||
使用 C API 进行模型推理的流程符合下面的模式:
|
使用 C API 进行模型推理的流程符合下面的模式:
|
||||||
|
|
||||||
```mermaid
|
```{mermaid}
|
||||||
graph LR
|
graph LR
|
||||||
A[创建推理句柄] --> B(读取图像)
|
A[创建推理句柄] --> B(读取图像)
|
||||||
B --> C(应用句柄进行推理)
|
B --> C(应用句柄进行推理)
|
||||||
|
@ -303,7 +303,7 @@ int main() {
|
||||||
cv::Point{(int)box.right, (int)box.bottom}, cv::Scalar{0, 255, 0});
|
cv::Point{(int)box.right, (int)box.bottom}, cv::Scalar{0, 255, 0});
|
||||||
}
|
}
|
||||||
|
|
||||||
cv::imwrite('output_detection.png', img);
|
cv::imwrite("output_detection.png", img);
|
||||||
|
|
||||||
// 销毁结果
|
// 销毁结果
|
||||||
mmdeploy_detector_release_result(bboxes, res_count, 1);
|
mmdeploy_detector_release_result(bboxes, res_count, 1);
|
||||||
|
|
|
@ -7,3 +7,4 @@ recommonmark
|
||||||
sphinx==4.0.2
|
sphinx==4.0.2
|
||||||
sphinx-copybutton
|
sphinx-copybutton
|
||||||
sphinx_markdown_tables
|
sphinx_markdown_tables
|
||||||
|
sphinxcontrib-mermaid
|
||||||
|
|
|
@ -2,4 +2,5 @@ h5py
|
||||||
mmcv
|
mmcv
|
||||||
onnx>=1.8.0
|
onnx>=1.8.0
|
||||||
opencv-python==4.5.4.60
|
opencv-python==4.5.4.60
|
||||||
|
sphinxcontrib-mermaid
|
||||||
torch
|
torch
|
||||||
|
|
Loading…
Reference in New Issue