Skip to content

Commit a133a13

Browse files
committed
force conversion to rgb or rgba depending on settings
1 parent ae1eeb1 commit a133a13

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
'stylegan2_pytorch = stylegan2_pytorch.cli:main',
99
],
1010
},
11-
version = '1.2.1',
11+
version = '1.2.2',
1212
license='GPLv3+',
1313
description = 'StyleGan2 in Pytorch',
1414
author = 'Phil Wang',

stylegan2_pytorch/stylegan2_pytorch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,12 +245,12 @@ def slerp(val, low, high):
245245
# dataset
246246

247247
def convert_rgb_to_transparent(image):
248-
if image.mode == 'RGB':
248+
if image.mode != 'RGBA':
249249
return image.convert('RGBA')
250250
return image
251251

252252
def convert_transparent_to_rgb(image):
253-
if image.mode == 'RGBA':
253+
if image.mode != 'RGB':
254254
return image.convert('RGB')
255255
return image
256256

0 commit comments

Comments
 (0)