Skip to content

Conversation

@taizan
Copy link
Contributor

@taizan taizan commented Sep 14, 2017

fill 255 to the image which has alpha channel

@uyongw
Copy link

uyongw commented Sep 24, 2017

With this PR, the image with a channel is correct now. But it seems has issue on image without a channel? Or does it miss to return the grayed image for RGB?

diff --git a/cgi-bin/paint_x2_unet/img2imgDataset.py b/cgi-bin/paint_x2_unet/img2imgDataset.py
index cc521de..3d424a7 100755
--- a/cgi-bin/paint_x2_unet/img2imgDataset.py
+++ b/cgi-bin/paint_x2_unet/img2imgDataset.py
@@ -36,6 +36,7 @@ def cvt2GRAY(img):
         return cv2.cvtColor(img2, cv2.COLOR_RGB2GRAY)
     else:
         # RGB image
+        return cv2.cvtColor(img, cv2.COLOR_RGB2GRAY)

 class ImageAndRefDataset(chainer.dataset.DatasetMixin):

whughw and others added 2 commits December 30, 2018 12:09
Fix the bug in function cvt2GRAY: it couldn't handle with RGB image because of a missing line of code, which resulted in a runtime error and caused an exception.
Update img2imgDataset.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants