提交 4e4fbdcf 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!563 dataset: Add variable comment for DATA_DIR of imageFolderDatasetv2

Merge pull request !563 from ms_yan/r0.6_tutorial_comment
......@@ -282,6 +282,8 @@ Data augmentation requires the `map` function. For details about how to use the
```
2. Define data augmentation operators. The following uses `Resize` as an example:
```python
# path to imagefolder directory. This directory needs to contain sub-directories which contain the images
DATA_DIR = "/path/to/imagefolder_directory"
dataset = ds.ImageFolderDatasetV2(DATA_DIR, decode=True) # Decode images.
resize_op = transforms.Resize(size=(500,500), interpolation=Inter.LINEAR)
dataset.map(input_columns="image", operations=resize_op)
......@@ -308,6 +310,8 @@ Figure 2: Image after its size is reset
```
2. Define data augmentation operators and use the `ComposeOp` API to combine multiple data augmentation operations. The following uses `RandomCrop` as an example:
```python
# path to imagefolder directory. This directory needs to contain sub-directories which contain the images
DATA_DIR = "/path/to/imagefolder_directory"
dataset = ds.ImageFolderDatasetV2(DATA_DIR)
transforms_list = [
......
......@@ -282,6 +282,8 @@ MindSpore提供`c_transforms`模块以及`py_transforms`模块函数供用户进
```
2. 定义数据增强算子,以`Resize`为例:
```python
# path to imagefolder directory. This directory needs to contain sub-directories which contain the images
DATA_DIR = "/path/to/imagefolder_directory"
dataset = ds.ImageFolderDatasetV2(DATA_DIR, decode=True) # Decode images.
resize_op = transforms.Resize(size=(500,500), interpolation=Inter.LINEAR)
dataset.map(input_columns="image", operations=resize_op)
......@@ -308,6 +310,8 @@ MindSpore提供`c_transforms`模块以及`py_transforms`模块函数供用户进
```
2. 定义数据增强算子,通过`ComposeOp`接口将多个数据增强组合使用, 以`RandomCrop`为例:
```python
# path to imagefolder directory. This directory needs to contain sub-directories which contain the images
DATA_DIR = "/path/to/imagefolder_directory"
dataset = ds.ImageFolderDatasetV2(DATA_DIR)
transforms_list = [
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册