preload script more robust for downloading gfpgan

This commit is contained in:
Lincoln Stein 2022-10-05 11:29:48 -04:00
parent 3feda31d82
commit 488890e6bb

View File

@ -72,6 +72,7 @@ if gfpgan:
if not os.path.exists(model_dest): if not os.path.exists(model_dest):
print('downloading gfpgan model file...') print('downloading gfpgan model file...')
os.makedirs(os.path.dirname(model_dest))
urllib.request.urlretrieve(model_url,model_dest) urllib.request.urlretrieve(model_url,model_dest)
except Exception: except Exception:
import traceback import traceback