diff --git a/mindspore/dataset/vision/c_transforms.py b/mindspore/dataset/vision/c_transforms.py index 9dd186a04a45f279e4ae710fdb87ddd25a585db0..25e96253786090d757c1e77d6867bf3a7608b25d 100644 --- a/mindspore/dataset/vision/c_transforms.py +++ b/mindspore/dataset/vision/c_transforms.py @@ -26,7 +26,7 @@ to improve their training models. >>> import mindspore.dataset as ds >>> import mindspore.dataset.transforms.c_transforms as c_transforms >>> import mindspore.dataset.vision.c_transforms as c_vision - >>> from mindspore.dataset.transforms.vision.utils import Border, ImageBatchFormat, Inter + >>> from mindspore.dataset.vision.utils import Border, ImageBatchFormat, Inter >>> dataset_dir = "path/to/imagefolder_directory" >>> # create a dataset that reads all files in dataset_dir with 8 threads diff --git a/model_zoo/official/cv/alexnet/src/dataset.py b/model_zoo/official/cv/alexnet/src/dataset.py index 651c76d6e3ea5049c08bc9d944baa94ebbf60a6a..688b6fa672fad925a5ffe6bf0d414aec705b3e62 100644 --- a/model_zoo/official/cv/alexnet/src/dataset.py +++ b/model_zoo/official/cv/alexnet/src/dataset.py @@ -18,7 +18,7 @@ Produce the dataset import mindspore.dataset as ds import mindspore.dataset.transforms.c_transforms as C -import mindspore.dataset.transforms.vision.c_transforms as CV +import mindspore.dataset.vision.c_transforms as CV from mindspore.common import dtype as mstype from .config import alexnet_cfg as cfg diff --git a/model_zoo/official/cv/faster_rcnn/src/dataset.py b/model_zoo/official/cv/faster_rcnn/src/dataset.py index 47dd80045761784fdc6cae05b8865bed5e7e9ee9..fd221ceddcbe3bbb4838c992b24de085ca48f012 100644 --- a/model_zoo/official/cv/faster_rcnn/src/dataset.py +++ b/model_zoo/official/cv/faster_rcnn/src/dataset.py @@ -22,7 +22,7 @@ from numpy import random import mmcv import mindspore.dataset as de -import mindspore.dataset.transforms.vision.c_transforms as C +import mindspore.dataset.vision.c_transforms as C import mindspore.dataset.transforms.c_transforms as CC import mindspore.common.dtype as mstype from mindspore.mindrecord import FileWriter diff --git a/model_zoo/official/cv/googlenet/src/dataset.py b/model_zoo/official/cv/googlenet/src/dataset.py index cc33d2e59445f5eda18853ffe83251ae3ad0b851..771624c5853760416c39cb7b625b25f1c592159f 100644 --- a/model_zoo/official/cv/googlenet/src/dataset.py +++ b/model_zoo/official/cv/googlenet/src/dataset.py @@ -20,7 +20,7 @@ import os import mindspore.common.dtype as mstype import mindspore.dataset as ds import mindspore.dataset.transforms.c_transforms as C -import mindspore.dataset.transforms.vision.c_transforms as vision +import mindspore.dataset.vision.c_transforms as vision from src.config import cifar_cfg as cfg diff --git a/model_zoo/official/cv/inceptionv3/src/dataset.py b/model_zoo/official/cv/inceptionv3/src/dataset.py index 113ad5690716b5d7c0fc608bfab75bbad5fb2b38..6ed7175b47a00b12a9809dbe1b8e84ebfecdde9f 100644 --- a/model_zoo/official/cv/inceptionv3/src/dataset.py +++ b/model_zoo/official/cv/inceptionv3/src/dataset.py @@ -18,7 +18,7 @@ Data operations, will be used in train.py and eval.py import mindspore.common.dtype as mstype import mindspore.dataset.engine as de import mindspore.dataset.transforms.c_transforms as C2 -import mindspore.dataset.transforms.vision.c_transforms as C +import mindspore.dataset.vision.c_transforms as C from src.config import config_gpu as cfg diff --git a/model_zoo/official/cv/lenet/src/dataset.py b/model_zoo/official/cv/lenet/src/dataset.py index cef69734839d1efeefefcc9dc31cd620c451917a..dca3a6af8aa8f4bcadc23ad862f3cd14bd5efaf9 100644 --- a/model_zoo/official/cv/lenet/src/dataset.py +++ b/model_zoo/official/cv/lenet/src/dataset.py @@ -17,9 +17,9 @@ Produce the dataset """ import mindspore.dataset as ds -import mindspore.dataset.transforms.vision.c_transforms as CV +import mindspore.dataset.vision.c_transforms as CV import mindspore.dataset.transforms.c_transforms as C -from mindspore.dataset.transforms.vision import Inter +from mindspore.dataset.vision import Inter from mindspore.common import dtype as mstype diff --git a/model_zoo/official/cv/lenet_quant/src/dataset.py b/model_zoo/official/cv/lenet_quant/src/dataset.py index cef69734839d1efeefefcc9dc31cd620c451917a..dca3a6af8aa8f4bcadc23ad862f3cd14bd5efaf9 100644 --- a/model_zoo/official/cv/lenet_quant/src/dataset.py +++ b/model_zoo/official/cv/lenet_quant/src/dataset.py @@ -17,9 +17,9 @@ Produce the dataset """ import mindspore.dataset as ds -import mindspore.dataset.transforms.vision.c_transforms as CV +import mindspore.dataset.vision.c_transforms as CV import mindspore.dataset.transforms.c_transforms as C -from mindspore.dataset.transforms.vision import Inter +from mindspore.dataset.vision import Inter from mindspore.common import dtype as mstype diff --git a/model_zoo/official/cv/maskrcnn/src/dataset.py b/model_zoo/official/cv/maskrcnn/src/dataset.py index 2330d81a5efadc64c0ec5071a8cd783e058c22bc..090e32727f8e7d65eaa8b7e4924f03a57cc81790 100644 --- a/model_zoo/official/cv/maskrcnn/src/dataset.py +++ b/model_zoo/official/cv/maskrcnn/src/dataset.py @@ -22,7 +22,7 @@ from numpy import random import mmcv import mindspore.dataset as de -import mindspore.dataset.transforms.vision.c_transforms as C +import mindspore.dataset.vision.c_transforms as C from mindspore.mindrecord import FileWriter from src.config import config import cv2 diff --git a/model_zoo/official/cv/mobilenetv2/src/dataset.py b/model_zoo/official/cv/mobilenetv2/src/dataset.py index 7e546991ef29b8887a13895e1102c7430d031716..377417618043d6cde9b45530c310bb1b9189f5ce 100644 --- a/model_zoo/official/cv/mobilenetv2/src/dataset.py +++ b/model_zoo/official/cv/mobilenetv2/src/dataset.py @@ -23,7 +23,7 @@ from mindspore import Tensor from mindspore.train.model import Model import mindspore.common.dtype as mstype import mindspore.dataset.engine as de -import mindspore.dataset.transforms.vision.c_transforms as C +import mindspore.dataset.vision.c_transforms as C import mindspore.dataset.transforms.c_transforms as C2 diff --git a/model_zoo/official/cv/mobilenetv2_quant/src/dataset.py b/model_zoo/official/cv/mobilenetv2_quant/src/dataset.py index 67c48c765c3035b29385f3d744f8f077ef74f440..431181a969974982f1f488ea8d5da4097890e439 100644 --- a/model_zoo/official/cv/mobilenetv2_quant/src/dataset.py +++ b/model_zoo/official/cv/mobilenetv2_quant/src/dataset.py @@ -19,9 +19,9 @@ import os from functools import partial import mindspore.common.dtype as mstype import mindspore.dataset.engine as de -import mindspore.dataset.transforms.vision.c_transforms as C +import mindspore.dataset.vision.c_transforms as C import mindspore.dataset.transforms.c_transforms as C2 -import mindspore.dataset.transforms.py_transforms +import mindspore.dataset.transforms.py_transforms as P2 import mindspore.dataset.vision.py_transforms as P @@ -150,7 +150,7 @@ def create_dataset_py(dataset_path, do_train, config, device_target, repeat_num= else: trans = [decode_op, resize_op, center_crop, to_tensor, normalize_op] - compose = mindspore.dataset.transforms.py_transforms.Compose(trans) + compose = P2.Compose(trans) ds = ds.map(input_columns="image", operations=compose, num_parallel_workers=8, python_multiprocessing=True) diff --git a/model_zoo/official/cv/mobilenetv3/src/dataset.py b/model_zoo/official/cv/mobilenetv3/src/dataset.py index 7b1a355053d47ff46b6af91dd99c196ecd29b0b3..1bd647c194bad64e06bae57e392c7138332ea182 100644 --- a/model_zoo/official/cv/mobilenetv3/src/dataset.py +++ b/model_zoo/official/cv/mobilenetv3/src/dataset.py @@ -17,7 +17,7 @@ create train or eval dataset. """ import mindspore.common.dtype as mstype import mindspore.dataset.engine as de -import mindspore.dataset.transforms.vision.c_transforms as C +import mindspore.dataset.vision.c_transforms as C import mindspore.dataset.transforms.c_transforms as C2 diff --git a/model_zoo/official/cv/nasnet/src/dataset.py b/model_zoo/official/cv/nasnet/src/dataset.py index 3386408243c2b51bdce4309adb37a52815521432..0b342ba098f8d16f93ec8f7b6c6d4d0c77bba55e 100755 --- a/model_zoo/official/cv/nasnet/src/dataset.py +++ b/model_zoo/official/cv/nasnet/src/dataset.py @@ -18,7 +18,7 @@ Data operations, will be used in train.py and eval.py import mindspore.common.dtype as mstype import mindspore.dataset.engine as de import mindspore.dataset.transforms.c_transforms as C2 -import mindspore.dataset.transforms.vision.c_transforms as C +import mindspore.dataset.vision.c_transforms as C def create_dataset(dataset_path, config, do_train, repeat_num=1): diff --git a/model_zoo/official/cv/resnet/src/dataset.py b/model_zoo/official/cv/resnet/src/dataset.py index 13c5a76dc93a8da36c3187c3fd4a2f20b453a14c..c9252834f2fa28cfe977d00015b783839aaf8c93 100755 --- a/model_zoo/official/cv/resnet/src/dataset.py +++ b/model_zoo/official/cv/resnet/src/dataset.py @@ -18,7 +18,7 @@ create train or eval dataset. import os import mindspore.common.dtype as mstype import mindspore.dataset.engine as de -import mindspore.dataset.transforms.vision.c_transforms as C +import mindspore.dataset.vision.c_transforms as C import mindspore.dataset.transforms.c_transforms as C2 from mindspore.communication.management import init, get_rank, get_group_size diff --git a/model_zoo/official/cv/resnet50_quant/src/dataset.py b/model_zoo/official/cv/resnet50_quant/src/dataset.py index 5de7688f331f9fc7a27e79f46b370aed7702444e..605543ec1228d81d4890a9af71e8136060ca0923 100755 --- a/model_zoo/official/cv/resnet50_quant/src/dataset.py +++ b/model_zoo/official/cv/resnet50_quant/src/dataset.py @@ -19,9 +19,9 @@ import os from functools import partial import mindspore.common.dtype as mstype import mindspore.dataset.engine as de -import mindspore.dataset.transforms.vision.c_transforms as C import mindspore.dataset.transforms.c_transforms as C2 -import mindspore.dataset.transforms.py_transforms +import mindspore.dataset.vision.c_transforms as C +import mindspore.dataset.transforms.py_transforms as P2 import mindspore.dataset.vision.py_transforms as P from mindspore.communication.management import init, get_rank, get_group_size from src.config import config_quant @@ -146,7 +146,7 @@ def create_dataset_py(dataset_path, do_train, repeat_num=1, batch_size=32, targe else: trans = [decode_op, resize_op, center_crop, to_tensor, normalize_op] - compose = mindspore.dataset.transforms.py_transforms.Compose(trans) + compose = P2.Compose(trans) ds = ds.map(input_columns="image", operations=compose, num_parallel_workers=8, python_multiprocessing=True) # apply batch operations diff --git a/model_zoo/official/cv/resnet_thor/src/dataset.py b/model_zoo/official/cv/resnet_thor/src/dataset.py index d9df510c178808f3bf4e3508ff3e2df8fd19db14..69ecf19c46b5e8bfd02c8fe64f54aee968bb9bb6 100644 --- a/model_zoo/official/cv/resnet_thor/src/dataset.py +++ b/model_zoo/official/cv/resnet_thor/src/dataset.py @@ -18,7 +18,7 @@ create train or eval dataset. import os import mindspore.common.dtype as mstype import mindspore.dataset.engine as de -import mindspore.dataset.transforms.vision.c_transforms as C +import mindspore.dataset.vision.c_transforms as C import mindspore.dataset.transforms.c_transforms as C2 from mindspore.communication.management import init, get_rank, get_group_size diff --git a/model_zoo/official/cv/resnext50/src/dataset.py b/model_zoo/official/cv/resnext50/src/dataset.py index fd4f15f01140bf99a87626b19de4c882b755279c..e8640e8c1bfb74ebf8570d699cb1ac43b1a61f4d 100644 --- a/model_zoo/official/cv/resnext50/src/dataset.py +++ b/model_zoo/official/cv/resnext50/src/dataset.py @@ -19,7 +19,7 @@ import os from mindspore.common import dtype as mstype import mindspore.dataset as de import mindspore.dataset.transforms.c_transforms as C -import mindspore.dataset.transforms.vision.c_transforms as V_C +import mindspore.dataset.vision.c_transforms as V_C from PIL import Image, ImageFile from src.utils.sampler import DistributedSampler diff --git a/model_zoo/official/cv/shufflenetv2/src/dataset.py b/model_zoo/official/cv/shufflenetv2/src/dataset.py index 13169c10780123a6f6e68fc3f40b10c6e2e675dd..10f5a80664c7c0c7ff44eac66539edc4566e1afb 100644 --- a/model_zoo/official/cv/shufflenetv2/src/dataset.py +++ b/model_zoo/official/cv/shufflenetv2/src/dataset.py @@ -21,7 +21,7 @@ from src.config import config_gpu as cfg import mindspore.common.dtype as mstype import mindspore.dataset.engine as de import mindspore.dataset.transforms.c_transforms as C2 -import mindspore.dataset.transforms.vision.c_transforms as C +import mindspore.dataset.vision.c_transforms as C class toBGR(): diff --git a/model_zoo/official/cv/ssd/src/dataset.py b/model_zoo/official/cv/ssd/src/dataset.py index 21269a7d4b2abf3a8001b67587995e6528f046e5..4ff66d30dbe2c5433b6fbe81d992b424f097cc3b 100644 --- a/model_zoo/official/cv/ssd/src/dataset.py +++ b/model_zoo/official/cv/ssd/src/dataset.py @@ -24,7 +24,7 @@ import numpy as np import cv2 import mindspore.dataset as de -import mindspore.dataset.transforms.vision.c_transforms as C +import mindspore.dataset.vision.c_transforms as C from mindspore.mindrecord import FileWriter from .config import config from .box_utils import jaccard_numpy, ssd_bboxes_encode diff --git a/model_zoo/official/cv/vgg16/src/dataset.py b/model_zoo/official/cv/vgg16/src/dataset.py index 0f6d538893612a3a96290c6f22a00f454682f904..ce1968645f5b007d5a52fb7a9974948a572553f0 100644 --- a/model_zoo/official/cv/vgg16/src/dataset.py +++ b/model_zoo/official/cv/vgg16/src/dataset.py @@ -19,7 +19,7 @@ import os from mindspore.common import dtype as mstype import mindspore.dataset as de import mindspore.dataset.transforms.c_transforms as C -import mindspore.dataset.transforms.vision.c_transforms as vision +import mindspore.dataset.vision.c_transforms as vision from PIL import Image, ImageFile from src.utils.sampler import DistributedSampler diff --git a/model_zoo/official/cv/warpctc/src/dataset.py b/model_zoo/official/cv/warpctc/src/dataset.py index 784bb4d84d689cf7a06b793622e5ae5b8ca59db2..defa96304265029513bce7df96a6519b0c6cfd84 100755 --- a/model_zoo/official/cv/warpctc/src/dataset.py +++ b/model_zoo/official/cv/warpctc/src/dataset.py @@ -19,7 +19,7 @@ import numpy as np import mindspore.common.dtype as mstype import mindspore.dataset.engine as de import mindspore.dataset.transforms.c_transforms as c -import mindspore.dataset.transforms.vision.c_transforms as vc +import mindspore.dataset.vision.c_transforms as vc from PIL import Image from src.config import config as cf diff --git a/model_zoo/official/cv/yolov3_darknet53/src/yolo_dataset.py b/model_zoo/official/cv/yolov3_darknet53/src/yolo_dataset.py index 947ab6136c50109bb84af3aa0d2dbe95f7e16255..b56a1fc4035f0c0908cd11d7d91aa42d9ecc5d59 100644 --- a/model_zoo/official/cv/yolov3_darknet53/src/yolo_dataset.py +++ b/model_zoo/official/cv/yolov3_darknet53/src/yolo_dataset.py @@ -19,7 +19,7 @@ import multiprocessing from PIL import Image from pycocotools.coco import COCO import mindspore.dataset as de -import mindspore.dataset.transforms.vision.c_transforms as CV +import mindspore.dataset.vision.c_transforms as CV from src.distributed_sampler import DistributedSampler from src.transforms import reshape_fn, MultiScaleTrans diff --git a/model_zoo/official/cv/yolov3_darknet53_quant/src/yolo_dataset.py b/model_zoo/official/cv/yolov3_darknet53_quant/src/yolo_dataset.py index af376e43cb439105337250bacde57e232ae15b27..59b423ad98b4a8abfb178a161e4136eddbc70a1f 100644 --- a/model_zoo/official/cv/yolov3_darknet53_quant/src/yolo_dataset.py +++ b/model_zoo/official/cv/yolov3_darknet53_quant/src/yolo_dataset.py @@ -18,7 +18,7 @@ import os from PIL import Image from pycocotools.coco import COCO import mindspore.dataset as de -import mindspore.dataset.transforms.vision.c_transforms as CV +import mindspore.dataset.vision.c_transforms as CV from src.distributed_sampler import DistributedSampler from src.transforms import reshape_fn, MultiScaleTrans diff --git a/model_zoo/official/cv/yolov3_resnet18/src/dataset.py b/model_zoo/official/cv/yolov3_resnet18/src/dataset.py index 0bfcc74bf164bbf07e0e751c3e74b2cb90b3893f..36ef978b08a87e5fd13a182093212ed4934d3a46 100644 --- a/model_zoo/official/cv/yolov3_resnet18/src/dataset.py +++ b/model_zoo/official/cv/yolov3_resnet18/src/dataset.py @@ -22,7 +22,7 @@ from matplotlib.colors import rgb_to_hsv, hsv_to_rgb from PIL import Image import mindspore.dataset as de from mindspore.mindrecord import FileWriter -import mindspore.dataset.transforms.vision.c_transforms as C +import mindspore.dataset.vision.c_transforms as C from src.config import ConfigYOLOV3ResNet18 iter_cnt = 0