Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix a channel input #131

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

fix a channel input #131

wants to merge 4 commits into from

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