未验证 提交 e2e1bb28 编写于 作者: 走神的阿圆's avatar 走神的阿圆 提交者: GitHub

add docs for dataformats in add_image (#803)

Co-authored-by: NPeter Pan <littlepanzh@gmail.com>
上级 8e562d4e
......@@ -201,7 +201,7 @@ Image 组件用于显示图片数据随训练的变化。在模型训练过程
Image 组件的记录接口如下:
```python
add_image(tag, img, step, walltime=None)
add_image(tag, img, step, walltime=None, dataformats="HWC")
```
接口参数说明如下:
| 参数 | 格式 | 含义 |
......@@ -210,6 +210,7 @@ add_image(tag, img, step, walltime=None)
| img | numpy.ndarray | 以ndarray格式表示的图片 |
| step | int | 记录的步数 |
| walltime | int | 记录数据的时间戳,默认为当前时间戳 |
| dataformats| string | 传入的图片格式,包括`NCHW``HWC``HW`,默认为`HWC`|
### Demo
下面展示了使用 Image 组件记录数据的示例,代码文件请见[Image组件](https://github.com/PaddlePaddle/VisualDL/blob/develop/demo/components/image_test.py)
......
......@@ -203,7 +203,7 @@ The Image is used to present the change of image data during training. Developer
The interface of the Image is shown as follows:
```python
add_image(tag, img, step, walltime=None)
add_image(tag, img, step, walltime=None, dataformats="HWC")
```
The interface parameters are described as follows:
| parameter | format | meaning |
......@@ -212,6 +212,7 @@ The interface parameters are described as follows:
| img | numpy.ndarray | Images in ndarray format |
| step | int | Record the training steps |
| walltime | int | Record the time-stamp of the data, the default is the current time-stamp |
| dataformats| string | Format of image,include `NCHW``HWC``HW`,default is `HWC`|
### Demo
The following shows an example of using Image to record data, and the script can be found in [Image Demo](https://github.com/PaddlePaddle/VisualDL/blob/develop/demo/components/image_test.py).
......
......@@ -146,6 +146,7 @@ def image(tag, image_array, step, walltime=None, dataformats="HWC"):
image_array (numpy.ndarray): Value of iamge
step (int): Step of image
walltime (int): Wall time of image
dataformats (string): Format of image
Return:
Package with format of record_pb2.Record
......
......@@ -171,6 +171,7 @@ class LogWriter(object):
img (numpy.ndarray): Image represented by a numpy.array
step (int): Step of image
walltime (int): Wall time of image
dataformats (string): Format of image
Example:
from PIL import Image
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册