detection: Make model dir before downloading

This commit is contained in:
Fam Zheng 2024-09-01 22:31:34 +01:00
parent cc33eebbe5
commit 45432648c2

View File

@ -2,6 +2,7 @@ import os
import oss2 import oss2
def get_model(name): def get_model(name):
os.makedirs(os.path.join(os.path.dirname(__file__), "model"), exist_ok=True)
fn = os.path.join(os.path.dirname(__file__), "model", name) fn = os.path.join(os.path.dirname(__file__), "model", name)
if os.path.exists(fn): if os.path.exists(fn):
return fn return fn