提交 559a6952 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!517 dataset: repair tutorial import problem

Merge pull request !517 from ms_yan/tutorial_format
......@@ -276,9 +276,9 @@ Data augmentation requires the `map` function. For details about how to use the
1. Import the module to the code.
```python
from mindspore.dataset.transforms.vision import Inter
import mindspore.dataset.transforms.vision.c_transforms as transforms
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
```
2. Define data augmentation operators. The following uses `Resize` as an example:
```python
......@@ -305,7 +305,6 @@ Figure 2: Image after its size is reset
```python
import mindspore.dataset.transforms.vision.py_transforms as transforms
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
```
2. Define data augmentation operators and use the `ComposeOp` API to combine multiple data augmentation operations. The following uses `RandomCrop` as an example:
```python
......
......@@ -61,6 +61,7 @@ To read a dataset using the `MindDataset` object, perform the following steps:
1. Create `MindDataset` for reading data.
```python
import os
CV_FILE_NAME = os.path.join(MODULE_PATH, "./imagenet.mindrecord")
data_set = ds.MindDataset(dataset_file=CV_FILE_NAME)
```
......
......@@ -276,9 +276,9 @@ MindSpore提供`c_transforms`模块以及`py_transforms`模块函数供用户进
1. 将该模块引入进代码。
```python
from mindspore.dataset.transforms.vision import Inter
import mindspore.dataset.transforms.vision.c_transforms as transforms
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
```
2. 定义数据增强算子,以`Resize`为例:
```python
......@@ -305,7 +305,6 @@ MindSpore提供`c_transforms`模块以及`py_transforms`模块函数供用户进
```python
import mindspore.dataset.transforms.vision.py_transforms as transforms
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
```
2. 定义数据增强算子,通过`ComposeOp`接口将多个数据增强组合使用, 以`RandomCrop`为例:
```python
......
......@@ -61,6 +61,7 @@ MindSpore天然支持读取MindSpore数据格式——`MindRecord`存储的数
1. 创建`MindDataset`,用于读取数据。
```python
import os
CV_FILE_NAME = os.path.join(MODULE_PATH, "./imagenet.mindrecord")
data_set = ds.MindDataset(dataset_file=CV_FILE_NAME)
```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册