switchablenorms / CelebAMask-HQ

A large-scale face dataset for face parsing, recognition, generation and editing.
2.05k stars 343 forks source link

Issue while running g_mask.py #26

Closed ghost closed 4 years ago

ghost commented 4 years ago

Hi, thanks for the code. I have been trying to preprocess the mask but I keep on getting this problem while I run g_mask.py code. Exception has occurred: TypeError bad operand type for unary +: 'str' File "D:\Datasets\CelebAMask-HQ\Data_preprocessing\g_mask.py", line 21, in <module> filename = os.path.join(folder_base, str(folder_num), str(k).rjust(5, '0')+ + '_' + label + '.png') TypeError: bad operand type for unary +: 'str'

So when I change the code from "+ +" to just "+" The code runs but generates black png file only. filename = os.path.join(folder_base, str(folder_num), str(k).rjust(5, '0')+ '_' + label + '.png') Am I doing something incorrect?

steven413d commented 4 years ago

Hi, The generated masks are one channel images (0 ~ 255), and the label values only range from 0 ~ 19. As a result, they would look black.