Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
60df3691
M
mindspore
项目概览
magicwindyyd
/
mindspore
与 Fork 源项目一致
Fork自
MindSpore / mindspore
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindspore
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
60df3691
编写于
4月 20, 2020
作者:
C
Cathy Wong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixup py Normalize doc: takes input CHW
上级
6369cf27
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
4 addition
and
7 deletion
+4
-7
mindspore/dataset/transforms/vision/py_transforms.py
mindspore/dataset/transforms/vision/py_transforms.py
+1
-1
tests/ut/python/dataset/test_normalizeOp.py
tests/ut/python/dataset/test_normalizeOp.py
+3
-2
tests/ut/python/dataset/test_random_color_adjust.py
tests/ut/python/dataset/test_random_color_adjust.py
+0
-4
未找到文件。
mindspore/dataset/transforms/vision/py_transforms.py
浏览文件 @
60df3691
...
@@ -220,7 +220,7 @@ class Decode:
...
@@ -220,7 +220,7 @@ class Decode:
class
Normalize
:
class
Normalize
:
"""
"""
Normalize the input Numpy image array of shape (
H, W, C
) with the given mean and standard deviation.
Normalize the input Numpy image array of shape (
C, H, W
) with the given mean and standard deviation.
The values of the array need to be in range [0.0, 1.0].
The values of the array need to be in range [0.0, 1.0].
...
...
tests/ut/python/dataset/test_normalizeOp.py
浏览文件 @
60df3691
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
import
mindspore.dataset.transforms.vision.c_transforms
as
vision
import
mindspore.dataset.transforms.vision.c_transforms
as
vision
import
numpy
as
np
import
numpy
as
np
import
matplotlib.pyplot
as
plt
import
mindspore.dataset
as
ds
import
mindspore.dataset
as
ds
from
mindspore
import
log
as
logger
from
mindspore
import
log
as
logger
...
@@ -114,6 +114,7 @@ def test_decode_op():
...
@@ -114,6 +114,7 @@ def test_decode_op():
# plt.subplot(131)
# plt.subplot(131)
# plt.imshow(image)
# plt.imshow(image)
# plt.title("DE image")
# plt.title("DE image")
# plt.show()
num_iter
+=
1
num_iter
+=
1
...
@@ -138,8 +139,8 @@ def test_decode_normalize_op():
...
@@ -138,8 +139,8 @@ def test_decode_normalize_op():
# plt.subplot(131)
# plt.subplot(131)
# plt.imshow(image)
# plt.imshow(image)
# plt.title("DE image")
# plt.title("DE image")
# plt.show()
num_iter
+=
1
num_iter
+=
1
break
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
...
...
tests/ut/python/dataset/test_random_color_adjust.py
浏览文件 @
60df3691
...
@@ -182,8 +182,6 @@ def test_random_color_jitter_op_saturation():
...
@@ -182,8 +182,6 @@ def test_random_color_jitter_op_saturation():
]
]
transform
=
py_vision
.
ComposeOp
(
transforms
)
transform
=
py_vision
.
ComposeOp
(
transforms
)
data2
=
ds
.
TFRecordDataset
(
DATA_DIR
,
SCHEMA_DIR
,
columns_list
=
[
"image"
],
shuffle
=
False
)
data2
=
ds
.
TFRecordDataset
(
DATA_DIR
,
SCHEMA_DIR
,
columns_list
=
[
"image"
],
shuffle
=
False
)
# data2 = data2.map(input_columns=["image"], operations=decode_op)
# data2 = data2.map(input_columns=["image"], operations=c_vision.Decode())
data2
=
data2
.
map
(
input_columns
=
[
"image"
],
operations
=
transform
())
data2
=
data2
.
map
(
input_columns
=
[
"image"
],
operations
=
transform
())
num_iter
=
0
num_iter
=
0
...
@@ -220,8 +218,6 @@ def test_random_color_jitter_op_hue():
...
@@ -220,8 +218,6 @@ def test_random_color_jitter_op_hue():
# First dataset
# First dataset
data1
=
ds
.
TFRecordDataset
(
DATA_DIR
,
SCHEMA_DIR
,
columns_list
=
[
"image"
],
shuffle
=
False
)
data1
=
ds
.
TFRecordDataset
(
DATA_DIR
,
SCHEMA_DIR
,
columns_list
=
[
"image"
],
shuffle
=
False
)
decode_op
=
c_vision
.
Decode
()
decode_op
=
c_vision
.
Decode
()
# channel_swap_op = c_vision.ChannelSwap()
# change_mode_op = c_vision.ChangeMode()
random_jitter_op
=
c_vision
.
RandomColorAdjust
((
1
,
1
),
(
1
,
1
),
(
1
,
1
),
(
0.2
,
0.2
))
random_jitter_op
=
c_vision
.
RandomColorAdjust
((
1
,
1
),
(
1
,
1
),
(
1
,
1
),
(
0.2
,
0.2
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录