提交 77a8f48a 编写于 作者: W Wang,Jeff

remove the part we need to change the color channel order

上级 99036ce8
...@@ -480,10 +480,6 @@ def load_image(file): ...@@ -480,10 +480,6 @@ def load_image(file):
# H(height), C(channel). PaddlePaddle requires # H(height), C(channel). PaddlePaddle requires
# the CHW order, so transpose them. # the CHW order, so transpose them.
im = im.transpose((2, 0, 1)) # CHW im = im.transpose((2, 0, 1)) # CHW
# In the training phase, the channel order of CIFAR
# image is B(Blue), G(green), R(Red). But PIL open
# image in RGB mode. It must swap the channel order.
im = im[(2, 1, 0), :, :] # BGR
im = im / 255.0 im = im / 255.0
# Add one dimension to mimic the list format. # Add one dimension to mimic the list format.
......
...@@ -494,10 +494,6 @@ def load_image(file): ...@@ -494,10 +494,6 @@ def load_image(file):
# H(height), C(channel). PaddlePaddle requires # H(height), C(channel). PaddlePaddle requires
# the CHW order, so transpose them. # the CHW order, so transpose them.
im = im.transpose((2, 0, 1)) # CHW im = im.transpose((2, 0, 1)) # CHW
# In the training phase, the channel order of CIFAR
# image is B(Blue), G(green), R(Red). But PIL open
# image in RGB mode. It must swap the channel order.
im = im[(2, 1, 0), :, :] # BGR
im = im / 255.0 im = im / 255.0
# Add one dimension to mimic the list format. # Add one dimension to mimic the list format.
......
...@@ -522,10 +522,6 @@ def load_image(file): ...@@ -522,10 +522,6 @@ def load_image(file):
# H(height), C(channel). PaddlePaddle requires # H(height), C(channel). PaddlePaddle requires
# the CHW order, so transpose them. # the CHW order, so transpose them.
im = im.transpose((2, 0, 1)) # CHW im = im.transpose((2, 0, 1)) # CHW
# In the training phase, the channel order of CIFAR
# image is B(Blue), G(green), R(Red). But PIL open
# image in RGB mode. It must swap the channel order.
im = im[(2, 1, 0), :, :] # BGR
im = im / 255.0 im = im / 255.0
# Add one dimension to mimic the list format. # Add one dimension to mimic the list format.
......
...@@ -536,10 +536,6 @@ def load_image(file): ...@@ -536,10 +536,6 @@ def load_image(file):
# H(height), C(channel). PaddlePaddle requires # H(height), C(channel). PaddlePaddle requires
# the CHW order, so transpose them. # the CHW order, so transpose them.
im = im.transpose((2, 0, 1)) # CHW im = im.transpose((2, 0, 1)) # CHW
# In the training phase, the channel order of CIFAR
# image is B(Blue), G(green), R(Red). But PIL open
# image in RGB mode. It must swap the channel order.
im = im[(2, 1, 0), :, :] # BGR
im = im / 255.0 im = im / 255.0
# Add one dimension to mimic the list format. # Add one dimension to mimic the list format.
......
...@@ -106,10 +106,6 @@ def infer(use_cuda, inference_program, params_dirname=None): ...@@ -106,10 +106,6 @@ def infer(use_cuda, inference_program, params_dirname=None):
# H(height), C(channel). PaddlePaddle requires # H(height), C(channel). PaddlePaddle requires
# the CHW order, so transpose them. # the CHW order, so transpose them.
im = im.transpose((2, 0, 1)) # CHW im = im.transpose((2, 0, 1)) # CHW
# In the training phase, the channel order of CIFAR
# image is B(Blue), G(green), R(Red). But PIL open
# image in RGB mode. It must swap the channel order.
im = im[(2, 1, 0), :, :] # BGR
im = im / 255.0 im = im / 255.0
# Add one dimension to mimic the list format. # Add one dimension to mimic the list format.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册