Skip to content

Commit

Permalink
Update visualize tool's doc.
Browse files Browse the repository at this point in the history
  • Loading branch information
IRONICBo committed Apr 21, 2023
1 parent bece673 commit 9514b47
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
27 changes: 27 additions & 0 deletions docs/en/02-how-to-run/useful_tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
27 changes: 27 additions & 0 deletions docs/zh_cn/02-how-to-run/useful_tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

0 comments on commit 9514b47

Please sign in to comment.