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

@@ -298,8 +298,7 @@ def download_and_cache_models(dirname):
download_url = 'https://github.com/opencv/opencv_zoo/blob/91fb0290f50896f38a0ab1e558b74b16bc009428/models/face_detection_yunet/face_detection_yunet_2022mar.onnx?raw=true'
model_file_name = 'face_detection_yunet.onnx'
if not os.path.exists(dirname):
os.makedirs(dirname)
os.makedirs(dirname, exist_ok=True)
cache_file = os.path.join(dirname, model_file_name)
if not os.path.exists(cache_file):