File size: 917 Bytes
f947839 | 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 30 31 32 33 | import hashlib
import json
from pathlib import Path
REPO = Path('/nfs/home/svu/e0833524/AFD')
ROOT = Path('/scratch/e0833524/afd_causal_forcing_b200')
CAMPAIGN = ROOT / 'campaigns/20261116-g24-160'
MODEL_REPO = 'yang29/afd-baseline-checkpoints'
RESULT_REPO = 'yang29/afd-causal-forcing-baselines-vbench'
LONG = Path('/scratch/e0833524/afd_long_video_b200')
METHODS = ('astrolabe', 'advdmd')
STEPS = (40, 80, 120, 160)
def read(path):
return json.loads(Path(path).read_text())
def write(path, value):
path = Path(path)
path.parent.mkdir(parents=True, exist_ok=True)
tmp = path.with_name(path.name + '.tmp')
tmp.write_text(json.dumps(value, indent=2, ensure_ascii=False) + '\n')
tmp.replace(path)
def sha(path):
h = hashlib.sha256()
with Path(path).open('rb') as f:
for chunk in iter(lambda: f.read(8 * 1024**2), b''):
h.update(chunk)
return h.hexdigest()
|