From 83f2cd4873fde4cf672eff67342cca701a538733 Mon Sep 17 00:00:00 2001 From: ms_yan <6576637+ms_yan@user.noreply.gitee.com> Date: Fri, 31 Jul 2020 09:25:39 +0800 Subject: [PATCH] add comment for variable Data_dir --- .../use/data_preparation/data_processing_and_augmentation.md | 4 ++++ .../use/data_preparation/data_processing_and_augmentation.md | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/tutorials/source_en/use/data_preparation/data_processing_and_augmentation.md b/tutorials/source_en/use/data_preparation/data_processing_and_augmentation.md index 3a861abe..f11336ee 100644 --- a/tutorials/source_en/use/data_preparation/data_processing_and_augmentation.md +++ b/tutorials/source_en/use/data_preparation/data_processing_and_augmentation.md @@ -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 = [ diff --git a/tutorials/source_zh_cn/use/data_preparation/data_processing_and_augmentation.md b/tutorials/source_zh_cn/use/data_preparation/data_processing_and_augmentation.md index 277da870..c4ff2c70 100644 --- a/tutorials/source_zh_cn/use/data_preparation/data_processing_and_augmentation.md +++ b/tutorials/source_zh_cn/use/data_preparation/data_processing_and_augmentation.md @@ -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 = [ -- GitLab