File size: 1,011 Bytes
22b4354 71b7d31 ce9c587 cb528cc f2a34e7 cb528cc 22b4354 71b7d31 22b4354 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
import functools
import os
PROJECT_ROOT_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), "..", "..")
MODELS_DIR = os.path.join(PROJECT_ROOT_DIR, "models")
OUTPUTS_DIR = os.path.join(PROJECT_ROOT_DIR, "outputs")
MODEL_CONFIG = os.path.join(PROJECT_ROOT_DIR, "modules", "config", "models.yaml")
MODEL_PATHS = {
"appearance_feature_extractor": os.path.join(MODELS_DIR, "appearance_feature_extractor.safetensors"),
"motion_extractor": os.path.join(MODELS_DIR, "motion_extractor.safetensors"),
"warping_module": os.path.join(MODELS_DIR, "warping_module.safetensors"),
"spade_generator": os.path.join(MODELS_DIR, "spade_generator.safetensors"),
"stitching_retargeting_module": os.path.join(MODELS_DIR, "stitching_retargeting_module.safetensors"),
"face_yolov8n": os.path.join(MODELS_DIR, "face_yolov8n.pt")
}
@functools.lru_cache
def init_dirs():
for dir_path in [
MODELS_DIR,
OUTPUTS_DIR
]:
os.makedirs(dir_path, exist_ok=True)
init_dirs()
|