From 9514b47c13e59ef96473ba891fa38c0378f144a3 Mon Sep 17 00:00:00 2001 From: Bo Date: Fri, 21 Apr 2023 11:37:09 +0800 Subject: [PATCH] Update visualize tool's doc. --- docs/en/02-how-to-run/useful_tools.md | 27 ++++++++++++++++++++++++ docs/zh_cn/02-how-to-run/useful_tools.md | 27 ++++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/docs/en/02-how-to-run/useful_tools.md b/docs/en/02-how-to-run/useful_tools.md index a402f2113d..b603df5f44 100644 --- a/docs/en/02-how-to-run/useful_tools.md +++ b/docs/en/02-how-to-run/useful_tools.md @@ -202,3 +202,30 @@ And the output look like this: | Max | 1.689 | 591.983 | +--------+------------+---------+ ``` + +## visualize + +This tool can be used to visualize model inference results in different backend. + +### Usage + +```bash +python tools/visualize.py \ + --deploy-cfg {DEPLOY_CFG} \ + --model-cfg {MODEL_CFG} \ + --deploy-path {DEPLOY_PATH} \ + --test-img {TEST_IMGS} \ + --checkpoint {CHECKPOINTS} \ + --save-dir {SAVE_DIR} \ + --device {DEVICE} +``` + +### Description of all arguments + +- `deploy-cfg` : The path of the deploy config file in MMDeploy codebase. +- `model-cfg` : The path of model config file in OpenMMLab codebase. +- `deploy-path` : The path of the model to be tested, if the backend contains multiple files, you can use it multiple times. +- `test-img` : The path of the images to be tested, you can use it multiple times. +- `checkpoint` : The path of the checkpoint to be tested, if it is used, the result will be cancated to right part. +- `save-dir` : The path to save the visualization results, if it not specified, it will be set to '.'. +- `device` : The device type. If not specified, it will be set to `cpu`. diff --git a/docs/zh_cn/02-how-to-run/useful_tools.md b/docs/zh_cn/02-how-to-run/useful_tools.md index 2f08cefa9f..5069196c06 100644 --- a/docs/zh_cn/02-how-to-run/useful_tools.md +++ b/docs/zh_cn/02-how-to-run/useful_tools.md @@ -202,3 +202,30 @@ python tools/profiler.py \ | Max | 1.689 | 591.983 | +--------+------------+---------+ ``` + +## visualize + +这个工具可以用来可视化不同推理引擎的推理结果。 + +### 用法 + +```bash +python tools/visualize.py \ + --deploy-cfg {DEPLOY_CFG} \ + --model-cfg {MODEL_CFG} \ + --deploy-path {DEPLOY_PATH} \ + --test-img {TEST_IMGS} \ + --checkpoint {CHECKPOINTS} \ + --save-dir {SAVE_DIR} \ + --device {DEVICE} +``` + +### 参数说明 + +- `deploy-cfg` : 输入的配置文件路径 +- `model-cfg` : 输入的模型配置文件路径 +- `deploy-path` : 测试的模型文件路径,如果部分模型含有多个文件,请多次使用该参数 +- `test-img` : 测试的图片路径,可以多次使用测试测试多张图片 +- `checkpoint` : PyTorch的权重文件,如果使用这个参数,推理的结果会被拼接到图像的右侧 +- `save-dir` : 保存可视化结果,如果没有指定则会被设为当前目录 +- `device` : 运行的设备类型,如果没有指定则会默认设置为`cpu`