File size: 763 Bytes
fe43247
 
 
 
 
 
 
 
999a3db
fe43247
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"""Application-wide configuration and resource paths."""

import torch
import yaml
import os
from pathlib import Path
from types import SimpleNamespace

project_root = Path(__file__).resolve().parent

device = torch.device("cuda" if torch.cuda.is_available() else "cpu")

vae_model_path = str(project_root / "models" / "vae.pth")
unet_model_path = str(project_root / "models" / "unet.pth")
ema_unet_model_path = str(project_root / "models" / "ema-unet.pth")

vae_plots_path = str(project_root / "plots" / "vae")
unet_plots_path = str(project_root / "plots" / "unet")

# Get the config in project root dir
config_path = os.path.join(project_root, "config.yaml")
with open(config_path, "r") as f:
    cfg_dict = yaml.safe_load(f)

cfg = SimpleNamespace(**cfg_dict)