Use os.makedirs(..., exist_ok=True)

This commit is contained in:
Aarni Koskela
2023-05-29 10:18:15 +03:00
parent 59419bd64a
commit 165ab44f03
6 changed files with 6 additions and 15 deletions

View File

@@ -70,11 +70,8 @@ gfpgan_constructor = None
def setup_model(dirname):
global model_path
if not os.path.exists(model_path):
os.makedirs(model_path)
try:
os.makedirs(model_path, exist_ok=True)
from gfpgan import GFPGANer
from facexlib import detection, parsing # noqa: F401
global user_path