Lotayou / Face-Renovation

Official repository of the paper "HiFaceGAN: Face Renovation via Collaborative Suppression and Replenishment".
https://arxiv.org/abs/2005.05005
GNU General Public License v3.0
284 stars 49 forks source link

TypeError in degrade.py #10

Open camjac251 opened 4 years ago

camjac251 commented 4 years ago

Does this support python 3.6? I'm running into issues with the degrade.py step. I set suffix to full and source_dir to a folder with 10,000 or so images from the FFHQ dataset but end up getting this error. Is 512x512 an absolute requirement for the first step to work?

Traceback (most recent call last):
  File "degrade.py", line 67, in <module>
    create_mixed_dataset(source_dir, suffix)
  File "degrade.py", line 53, in create_mixed_dataset
    trans = get_by_suffix(suffix) # or use other functions
  File "degrade.py", line 47, in get_by_suffix
    raise('%s not supported' % suffix)
TypeError: exceptions must derive from BaseException
bycloudai commented 4 years ago

the original code only has suffix=down as an option. The other options do exist, but idk why it wasn't included.

This is my solution:

go to degrade.py and remove #elif... at line 45 and replace it with

elif suffix == 'full':
        return get_full()
    elif suffix == 'noise':
        return get_noise()
    elif suffix == 'blur':
        return get_blur()
    elif suffix == 'jpeg':
        return get_jpeg()
    elif suffix == '16x':
        return get_jpeg()
coloneldbugger commented 4 years ago

@cloudweather why did you use get_jpeg() for the 16x suffix?

I created a new function based on get_down()

using the value 0.0625 for scale. Works for 165 images then crashes and I'm not sure why.