Skip to content

Commit

Permalink
[Docs] Enhance inferencer docs (#2495)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben-Louis authored Jun 29, 2023
1 parent 11f2966 commit 1ab662a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/en/user_guides/inference.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,17 @@ The inferencer is capable of processing a range of input types, which includes t
- A list of image arrays (NA for CLI tool)
- A webcam (in which case the `input` parameter should be set to either `'webcam'` or `'webcam:{CAMERA_ID}'`)

Please note that when the input corresponds to multiple images, such as when the input is a video or a folder path, the inference process needs to iterate over the results generator in order to perform inference on all the frames or images within the folder. Here's an example in Python:

```python
folder_path = 'tests/data/coco'

result_generator = inferencer(folder_path, show=True)
results = [result for result in result_generator]
```

In this example, the `inferencer` takes the `folder_path` as input and returns a generator object (`result_generator`) that produces inference results. By iterating over the `result_generator` and storing each result in the `results` list, you can obtain the inference results for all the frames or images within the folder.

### Custom Pose Estimation Models

The inferencer provides several methods that can be used to customize the models employed:
Expand Down
11 changes: 11 additions & 0 deletions docs/zh_cn/user_guides/inference.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,17 @@ python demo/inferencer_demo.py 'tests/data/coco/000000000785.jpg' \

- 摄像头(在这种情况下,输入参数应该设置为`webcam``webcam:{CAMERA_ID}`

当输入对应于多个图像时,例如输入为**视频****文件夹**路径时,推理生成器必须被遍历,以便推理器对视频/文件夹中的所有帧/图像进行推理。以下是一个示例:

```python
folder_path = 'tests/data/coco'

result_generator = inferencer(folder_path, show=True)
results = [result for result in result_generator]
```

在这个示例中,`inferencer` 接受 `folder_path` 作为输入,并返回一个生成器对象(`result_generator`),用于生成推理结果。通过遍历 `result_generator` 并将每个结果存储在 `results` 列表中,您可以获得视频/文件夹中所有帧/图像的推理结果。

### 自定义姿态估计模型

`MMPoseInferencer`提供了几种可用于自定义所使用的模型的方法:
Expand Down

0 comments on commit 1ab662a

Please sign in to comment.