Unverified Commit fd11b874 authored by liukuikun's avatar liukuikun Committed by GitHub
Browse files

[Docs] Add convention for the order of data transforms (#2442)

parent 6e818309
......@@ -19,6 +19,10 @@ In MMCV, we use various callable data transformation classes to manipulate data.
The data transformation class reads some fields of the input dictionary and may add or update some fields. The keys of these fields are mostly fixed. For example, `Resize` will always read fields such as `"img"` in the input dictionary. More information about the conventions for input and output fields could be found in the documentation of the corresponding class.
```{note}
By convention, the order of image shape which is used as **initialization parameters** in data transformation (such as Resize, Pad) is (width, height). In the dictionary returned by the data transformation, the image related shape, such as `img_shape`, `ori_shape`, `pad_shape`, etc., is (height, width).
```
MMCV provides a unified base class called `BaseTransform` for all data transformation classes:
```python
......
......@@ -19,6 +19,10 @@
数据变换类会读取输入字典的某些字段,并且可能添加、或者更新某些字段。这些字段的键大部分情况下是固定的,如 `Resize` 会固定地读取输入字典中的 `"img"` 等字段。我们可以在对应类的文档中了解对输入输出字段的约定。
```{note}
默认情况下,在需要图像尺寸作为**初始化参数**的数据变换 (如Resize, Pad) 中,图像尺寸的顺序均为 (width, height)。在数据变换**返回的字典**中,图像相关的尺寸, 如 `img_shape`、`ori_shape`、`pad_shape` 等,均为 (height, width)。
```
MMCV 为所有的数据变换类提供了一个统一的基类 (`BaseTransform`):
```python
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment