From 22ffd0d2f64094a05eda25a199434cfa78797acc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=A3=9E=E7=8C=AA?= <106524776+ooooo-create@users.noreply.github.com> Date: Tue, 15 Aug 2023 14:04:25 +0800 Subject: [PATCH] [Doc]fix inference_segmentor to inference_model (#3261) Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily get feedback. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers. ## Motivation there is a code mistake in `docs\zh_cn\get_started.md` and `docs\en\get_started.md`,it use the 0.x api,which is changed in 1.x ## Modification `docs\zh_cn\get_started.md` ,`docs\en\get_started.md` fix inference_segmentor --> inference_model ## BC-breaking (Optional) Does the modification introduce changes that break the backward-compatibility of the downstream repos? If so, please describe how it breaks the compatibility and how the downstream projects should modify their code to keep compatibility with this PR. ## Use cases (Optional) If this PR introduces a new feature, it is better to list some use cases here, and update the documentation. ## Checklist 1. Pre-commit or other linting tools are used to fix the potential lint issues. 2. The modification is covered by complete unit tests. If not, please add more unit test to ensure the correctness. 3. If the modification has potential influence on downstream projects, this PR should be tested with downstream projects, like MMDet or MMDet3D. 4. The documentation has been modified accordingly, like docstring or example tutorials. --- docs/en/get_started.md | 4 ++-- docs/zh_cn/get_started.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/en/get_started.md b/docs/en/get_started.md index 5c6033d549..3f957eb4e1 100644 --- a/docs/en/get_started.md +++ b/docs/en/get_started.md @@ -110,8 +110,8 @@ show_result_pyplot(model, img, result, show=True, out_file='result.jpg', opacity # test a video and show the results video = mmcv.VideoReader('video.mp4') for frame in video: - result = inference_segmentor(model, frame) - show_result_pyplot(model, result, wait_time=1) + result = inference_model(model, frame) + show_result_pyplot(model, frame, result, wait_time=1) ``` You can modify the code above to test a single image or a video, both of these options can verify that the installation was successful. diff --git a/docs/zh_cn/get_started.md b/docs/zh_cn/get_started.md index b92ab33490..ca375f3d9d 100644 --- a/docs/zh_cn/get_started.md +++ b/docs/zh_cn/get_started.md @@ -110,8 +110,8 @@ show_result_pyplot(model, img, result, show=True, out_file='result.jpg', opacity # 在一段视频上测试并可视化分割结果 video = mmcv.VideoReader('video.mp4') for frame in video: - result = inference_segmentor(model, frame) - show_result_pyplot(model, result, wait_time=1) + result = inference_model(model, frame) + show_result_pyplot(model, frame, result, wait_time=1) ``` 您可以修改上面的代码来测试单个图像或视频,这两个选项都可以验证安装是否成功。