提交 60df3691 编写于 作者: C Cathy Wong

Fixup py Normalize doc: takes input CHW

上级 6369cf27
...@@ -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].
......
...@@ -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__":
......
...@@ -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.
先完成此消息的编辑!
想要评论请 注册