From 77a8f48a02927d4e58643d57367b8e648c0d98fe Mon Sep 17 00:00:00 2001 From: "Wang,Jeff" Date: Fri, 8 Jun 2018 14:39:46 -0700 Subject: [PATCH] remove the part we need to change the color channel order --- 03.image_classification/README.cn.md | 4 ---- 03.image_classification/README.md | 4 ---- 03.image_classification/index.cn.html | 4 ---- 03.image_classification/index.html | 4 ---- 03.image_classification/train.py | 4 ---- 5 files changed, 20 deletions(-) diff --git a/03.image_classification/README.cn.md b/03.image_classification/README.cn.md index c55d230..cef4636 100644 --- a/03.image_classification/README.cn.md +++ b/03.image_classification/README.cn.md @@ -480,10 +480,6 @@ def load_image(file): # H(height), C(channel). PaddlePaddle requires # the CHW order, so transpose them. 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 # Add one dimension to mimic the list format. diff --git a/03.image_classification/README.md b/03.image_classification/README.md index d304be8..f01d0af 100644 --- a/03.image_classification/README.md +++ b/03.image_classification/README.md @@ -494,10 +494,6 @@ def load_image(file): # H(height), C(channel). PaddlePaddle requires # the CHW order, so transpose them. 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 # Add one dimension to mimic the list format. diff --git a/03.image_classification/index.cn.html b/03.image_classification/index.cn.html index 069b622..84f3966 100644 --- a/03.image_classification/index.cn.html +++ b/03.image_classification/index.cn.html @@ -522,10 +522,6 @@ def load_image(file): # H(height), C(channel). PaddlePaddle requires # the CHW order, so transpose them. 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 # Add one dimension to mimic the list format. diff --git a/03.image_classification/index.html b/03.image_classification/index.html index 54634a0..7919a04 100644 --- a/03.image_classification/index.html +++ b/03.image_classification/index.html @@ -536,10 +536,6 @@ def load_image(file): # H(height), C(channel). PaddlePaddle requires # the CHW order, so transpose them. 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 # Add one dimension to mimic the list format. diff --git a/03.image_classification/train.py b/03.image_classification/train.py index 87d3cf2..50bc52f 100644 --- a/03.image_classification/train.py +++ b/03.image_classification/train.py @@ -106,10 +106,6 @@ def infer(use_cuda, inference_program, params_dirname=None): # H(height), C(channel). PaddlePaddle requires # the CHW order, so transpose them. 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 # Add one dimension to mimic the list format. -- GitLab