worldmem-baseline-evals / deployment /cache_metrics.py
BonanDing's picture
Add isolated Minecraft and RE10K baseline evaluation suite
59630ba verified
Raw History Blame
561 Bytes
"""Prepare the exact common metric weights before offline evaluation workers."""
from pathlib import Path
import sys
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "shared/metric_vendor"))
from torchmetrics.image.fid import FrechetInceptionDistance
from torchmetrics.image.lpip import LearnedPerceptualImagePatchSimilarity
LearnedPerceptualImagePatchSimilarity(net_type="alex", normalize=True).eval()
FrechetInceptionDistance(feature=2048, normalize=False).eval()
print("Common LPIPS AlexNet and FID Inception weights are cached.", flush=True)