Registry & reference

MetricRegistry discovery, registered-metric tables, CLI surface, checkpoints, and package layout.

On this page
Metric pages42 ids · click to expand

MetricRegistry

The default registry loads all built-in entries from BUILTIN_METRIC_REGISTRY_ENTRIES in registry.py.

Discovery

worldfoundry-eval metric list
worldfoundry-eval metric list --json

worldfoundry-eval metric show fid
worldfoundry-eval metric show clip-score --json

worldfoundry-eval metric validate fid clip_score has_artifact:generated_artifact

Registry keys are normalized case-insensitively with hyphens instead of underscores (clip_score, clip-score, and clipscore resolve to the same entry). Parameterized ids use a prefix:

PatternExampleMeaning
has_artifact:<name>has_artifact:generated_artifactReturns 1 when the named artifact exists on a result.
numeric:<name>numeric:rewardEmits the numeric field <name> from result metadata/scores.

Python API

from worldfoundry.evaluation.tasks.metrics.registry import (
    default_metric_registry,
    list_metric_registry_entries,
    validate_metric_ids,
    create_existing_results_metric,
)

# List all registered entries
for entry in list_metric_registry_entries():
    print(entry.id, entry.family, entry.aliases)

# Resolve alias → canonical id
registry = default_metric_registry()
entry = registry.get("clip-score")
canonical = registry.canonical_metric_id("numeric:reward")

# Bulk validation
payload = validate_metric_ids(["fid", "unknown_metric"])
assert payload["ok"] is False

# Build offline evaluator for scorecard runs
metric = create_existing_results_metric(
    metrics=["artifact_count", "has_artifact:video"],
    required_artifacts=["generated_artifact"],
)

Registered metrics

Direction: higher is better, lower is better.

Image distribution (family=distribution)

Set-level metrics comparing reference and generated image collections. Torch-fidelity metrics (fid/, kid/, inception_score/, …) share vendored code under _shared/vendor/torch_fidelity/; standalone helpers include Clean-FID, CMMD, IPR, Vendi, Rarity, and fwd/vendor/pytorchfwd.

MetricAliasesDirectionPrimary API
inception_scoreis, isccompute_inception_score(images_dir)
fidfrechet-inception-distance, clip-fid, clip_fid, fid-vid, fid_vid, fvid, swav-fid, swav_fid, scene-fid, scene_fid, object-crop-fidcompute_fid(...); variants via feature_extractor or compute_scene_fid
kidkernel-inception-distancecompute_kid(...)
precision_recallprc, precision-recallcompute_precision_recall(...)
fwdfrechet-wavelet-distancecompute_fwd(...)
cmmdclip-mmd, clip_mmdcompute_cmmd(reference_dir, eval_dir)
pplperceptual-path-length, perceptual_path_lengthcompute_ppl(...)
mindmid, monge-inception-distance, monge_inception_distancecompute_mind(...)
clean_fidclean-fid, improved-fidcompute_clean_fid(reference, generated)
vendi_scorevendi-score, vendicompute_vendi_score(...)
improved_precision_recallipr, alpha-precision, beta-recall, realism_score, ipr-realism, realismcompute_improved_precision_recall(...), compute_realism_score(...)
rarity_scorerarity-score, rscompute_mean_rarity_score(...)
facescoreface-score, face_scorecompute_facescore(...), FaceScoreModel(...)
facesim_curface-sim-cur, facesim-curricularcompute_facesim_cur(...) (OpenS2V; InsightFace + CurricularFace weights)
gme_scoregmescore, gme-scorecompute_gme_score(...) (OpenS2V; GME-Qwen2-VL)
nexus_scorenexusscore, nexus-scorecompute_nexus_score(...) (OpenS2V; YOLO-World + GME)
natural_scorenaturalscore, natural-scorecompute_natural_score(...) (OpenS2V; GPT API)
artscoreart-score, art_scoreload_artscore_model(...)
trendtrend-jsd, trend_jsdcompute_trend(...), compute_trend_jsd(...)
fldfeature-likelihood-divergence, flscompute_fld(train, test, gen features)
multimodal_midmid-metric, mutual-information-divergencecompute_multimodal_mid(...)
fjdfrechet-joint-distancecompute_fjd_from_joint_embeddings(...)
crosslidcross-lid, cross_lidcompute_crosslid(...)
cfidconditional-fid, conditional_fidcompute_cfid(...)
ssdsemantic-similarity-distancecompute_ssd(...)
linear_separabilitylinear-separability, stylegan-lscompute_linear_separability(confusion_matrix)
rkerenyi-kernel-entropy, rke-mccompute_rke(features), compute_rrke(ref, gen)
fddfrechet-denoised-distancecompute_fdd(reference_dir, generated_dir)
cisconditional-inception-score, bcis, wciscompute_cis(class_probs), compute_cis_from_predictions(...)
rndrnd-score, random-network-distillationcompute_rnd(features), compute_rnd_from_images(...)
attribute_sadsad, attribute-sadcompute_attribute_sad(hcs_real, hcs_gen, text_list)
attribute_padpad, attribute-padcompute_attribute_pad(hcs_real, hcs_gen, text_list)
from worldfoundry.evaluation.tasks.metrics import (
    compute_distribution_metrics,
    compute_fid,
    compute_inception_score,
    compute_clip_fid,
    compute_cmmd,
    compute_clean_fid,
    compute_fwd,
    compute_improved_precision_recall,
    compute_vendi_score,
    compute_mean_rarity_score,
)

# Batch via torch-fidelity flags: isc, fid, kid, prc
scores = compute_distribution_metrics(
    "/path/to/reference",
    "/path/to/generated",
    metrics=("fid", "kid", "prc"),
)

fid = compute_fid("/path/to/reference", "/path/to/generated")
clip_fid = compute_fid("/path/to/reference", "/path/to/generated", feature_extractor="clip-vit-b-32")
swav_fid = compute_fid("/path/to/reference", "/path/to/generated", feature_extractor="swav-resnet50")
scene_fid = compute_scene_fid("/path/ref", "/path/gen", reference_bboxes_json="...")
is_scores = compute_inception_score("/path/to/generated")
cmmd = compute_cmmd("/path/to/reference", "/path/to/generated")
clean_fid = compute_clean_fid("/path/to/reference", "/path/to/generated")
fwd = compute_fwd("/path/to/reference", "/path/to/generated")
ipr = compute_improved_precision_recall("/path/to/reference", "/path/to/generated")
vendi = compute_vendi_score(feature_matrix)

Video distribution (family=distribution, video tags)

MetricAliasesDirectionPrimary API
fvdfrechet-video-distancecompute_fvd_from_numpy(...), compute_fvd_from_frame_dirs(...)
fvmdfrechet-video-motion-distancecompute_fvmd(reference_videos, generated_videos)
jedijedi-mmd, video-jedicompute_jedi_from_features(...), JEDiMetric(...)
import numpy as np
from worldfoundry.evaluation.tasks.metrics import (
    compute_fvd_from_numpy,
    compute_fvd_from_frame_dirs,
    compute_fid_vid,
    compute_fvmd,
    compute_jedi_from_features,
)

# uint8 arrays: (N, T, H, W, C)
fvd = compute_fvd_from_numpy(real_videos, gen_videos, device="cuda")

fvd = compute_fvd_from_frame_dirs(
    reference_frame_dirs=["/path/to/ref_frames/video_0"],
    generated_frame_dirs=["/path/to/gen_frames/video_0"],
)

fid_vid = compute_fid("/path/to/ref_frames", "/path/to/gen_frames")  # alias: fid_vid
fvmd = compute_fvmd("/path/to/reference_videos", "/path/to/generated_videos")

jedi = compute_jedi_from_features(train_features, test_features)

Perceptual pairwise (family=perceptual)

Pairwise similarity between reference and generated images (condition consistency, reconstruction quality).

MetricAliasesDirectionPrimary API
lpipscompute_lpips(ref_image, gen_image)
ssimcompute_ssim(...)
ms_ssimms-ssimcompute_ms_ssim(...)
psnrcompute_psnr(...)
dino_similaritydino-similarity, dino_simcompute_dino_similarity(...)
dreamsimdream-simcompute_dreamsim(...)
cpbdcpbd-sharpnesscompute_cpbd(image)
fsimfeature-similarity-index, fsimccompute_fsim(ref_image, gen_image)
mask_accuracymask-accuracy, mask_acccompute_mask_accuracy(...), compute_mask_iou(...)
object_detectionobject-detection, detection-success-ratecompute_object_detection_success_rate(...)
lqslayout-quality-scorecompute_lqs(groundtruth_layout, predicted_layout)
import numpy as np
from worldfoundry.evaluation.tasks.metrics import (
    compute_lpips,
    compute_ssim,
    compute_ms_ssim,
    compute_psnr,
    compute_perceptual_bundle,
    compute_dino_similarity,
    compute_dreamsim,
)

ref = np.load("reference.npy")  # HxWxC uint8 or float
gen = np.load("generated.npy")

bundle = compute_perceptual_bundle(ref, gen)  # lpips, ssim, ms_ssim, psnr
dino_sim = compute_dino_similarity(ref, gen)
dreamsim_dist = compute_dreamsim(ref, gen)

CLI surface

CommandScope
worldfoundry-eval metric listPrint or JSON-export all registry entries.
worldfoundry-eval metric show <id>Show one entry, resolved aliases, parameterized prefix.
worldfoundry-eval metric validate <id>...Bulk-resolve ids; exit 1 on unknown ids.
worldfoundry-eval evaluate --metric ...Built-in existing-results metrics only (artifact_count, required_artifacts_present, has_artifact:<name>, numeric, numeric:<name>).
worldfoundry-eval plan create --metric ...Same built-in metric ids when constructing a run plan JSON.

Distribution and perceptual metrics are invoked through Python today. Benchmark runners may call the same underlying implementations when computing official metric stacks (EvalCrafter IS/FID paths, MiraBench FVD, and similar). Multimodal scorers (CLIPScore, VQAScore, ITMScore) are exposed through worldfoundry.evaluation.tasks.metrics.get_score_model(...) and implemented in execution/runners/_scorers/.

Dependencies

Install the distribution-metrics extra for torch-fidelity, Clean-FID, CMMD, perceptual torchmetrics, and related compute paths:

pip install -e ".[distribution_metrics]"

Core dependencies in the distribution_metrics extra include torch, torchvision, torchmetrics, scikit-learn, scipy, transformers, pillow, and the optional metric packages declared in pyproject.toml.

Keep heavy imports lazy: importing worldfoundry.evaluation.tasks.metrics should not require every checkpoint to be present until a specific compute_* function is called.

Checkpoints and environment variables

VariableUsed byPurpose
WORLDFOUNDRY_HFD_ROOTHugging Face based metrics and scorersShared HF cache root or staged local model root.
WORLDFOUNDRY_T2V_METRICS_CACHE_DIRCLIPScore, ITMScore, VQAScorePreferred cache for multimodal scorer models. Falls back to WORLDFOUNDRY_HFD_ROOT.
WORLDFOUNDRY_CKPT_DIRFVD, ArtScore, shared standalone filesDefault root for staged .pt, .pth, .bin, and other non-HF files.
WORLDFOUNDRY_FVD_I3D_CKPTFVDPath to i3d_pretrained_400.pt for Inception I3D features.
WORLDFOUNDRY_MIRABENCH_FVD_I3D_CKPTFVD (MiraBench fallback)Alternate I3D checkpoint path.
WORLDFOUNDRY_JEDI_MODEL_DIR / WORLDFOUNDRY_JEDI_VJEPA_DIR / WORLDFOUNDRY_VJEPA_MODEL_DIRJEDiV-JEPA model directory.
WORLDFOUNDRY_JEDI_CONFIG_PATHJEDiYAML config; bundled asset at worldfoundry/data/benchmarks/assets/jedi/vith16_ssv2_16x2x3.yaml.
WORLDFOUNDRY_JEDI_FEATURE_PATHJEDiOptional precomputed feature archive.
WORLDFOUNDRY_FDD_DAE_CKPTFDDPretrained DAE weights for Frechet Denoised Distance.
WORLDFOUNDRY_DINOV2_BASE_MODEL_DIRDINO similarityLocal facebook/dinov2-base model directory.
WORLDFOUNDRY_DINO_VITB16_MODEL_DIRDINO-family metricsLocal facebook/dino-vitb16 model directory.
WORLDFOUNDRY_OPENS2V_WEIGHT_DIRFaceSim-CurOpenS2V InsightFace + CurricularFace bundle root.
WORLDFOUNDRY_GME_MODEL_PATHGmeScore, NexusScoreGME-Qwen2-VL model path.
WORLDFOUNDRY_YOLO_WORLD_CKPTNexusScoreYOLO-World image-prompt adapter checkpoint.
WORLDFOUNDRY_YOLO_CLIP_MODELNexusScoreCLIP backbone for YOLO-World eval.
OPENAI_API_KEYNaturalScoreGPT API key for OpenS2V naturalness rating.

FVD resolution order is documented in fvd/fvd_core.py: explicit i3d_checkpoint argument → WORLDFOUNDRY_FVD_I3D_CKPTWORLDFOUNDRY_MIRABENCH_FVD_I3D_CKPT → paths under WORLDFOUNDRY_CKPT_DIR.

Architecture

worldfoundry/evaluation/tasks/metrics/
├── _base.py             # MetricModuleSpec protocol + registry-entry factory
├── _discover.py         # Auto-discover METRIC_MODULE exports from per-metric folders
├── _shared/             # Cross-metric infra (distribution helpers, torch-fidelity loader)
│   └── vendor/torch_fidelity/  # Vendored torch-fidelity (Apache-2.0)
├── registry.py          # MetricRegistryEntry, MetricRegistry, legacy + discovered entries
├── builtins.py          # BuiltinExistingResultsMetric (offline result scoring)
├── fid/ kid/ …          # One folder per distribution metric (METRIC_ID, compute, METRIC_MODULE)
├── lpips/ ssim/ …       # One folder per pairwise perceptual metric
├── fvd/ fvmd/ opens2v/ sadpad/  # Video distribution + OpenS2V + SadPaD attributes
├── cmmd/ clean_fid/ vendi_score/ …      # Standalone distribution helpers
└── jedi/                # Video JEPA distance (wrapper.py + vendored JEDi)

Per-metric module layout

Each migrated metric folder exports a unified surface:

ExportPurpose
METRIC_ID, ALIASES, HIGHER_IS_BETTER, FAMILY, TAGSRegistry metadata
METRIC_MODULE:class:MetricModuleSpec for auto-discovery
compute(...) / compute_<name>(...)Stable compute API by metric family
Paper / repo linksListed inline under each metric in metric recipe pages

Registry entries for migrated metrics are registered via _discover.discover_metric_registry_entries() instead of hard-coded duplicates in registry.py.

Import surface

Top-level metrics/__init__.py re-exports compute_* functions from per-metric modules so existing from worldfoundry.evaluation.tasks.metrics import compute_fid imports keep working.

Benchmark catalog metrics and official-result normalization belong in execution/runners/; benchmark-specific setup belongs on the matching Benchmark Hub page.