Skip to content
Back to skills

Model Based Metrics

ASecurity

"Use TorchMetrics metrics that load pretrained models, feature

  • 247 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 9, 2026
devopspythonapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill model-based-metrics --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Model Based Metrics?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Model Based Metrics
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-model-based-metrics/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-model-based-metrics)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: model-based-metrics
description: "Use TorchMetrics metrics that load pretrained models, feature
  extractors, external weights, caches, or download-backed assets."
disable-model-invocation: true
metadata:
  disco-role: operating
license: Apache 2.0
---

# Model-Based Metrics

Use this sub-skill when a TorchMetrics metric depends on pretrained weights, a model or tokenizer, external feature extractors, a cache, or a network-backed asset.

## Route map

- Read [references/model-based-api.md](references/model-based-api.md) when you need constructor arguments, supported model names, cache/device rules, or output-shape details for model-backed metrics.
- Read [references/model-based-workflows.md](references/model-based-workflows.md) when you need copyable usage patterns or planning guidance for BERTScore, CLIPScore, CLIP-IQA, FID/KID, LPIPS/DISTS/ARNIQA, DNSMOS, NISQA, VMAF, or related metrics.
- Read [references/troubleshooting.md](references/troubleshooting.md) when import succeeds but model loading, cache lookup, device placement, or optional dependency handling fails.
- Run [scripts/model_based_import_check.py](scripts/model_based_import_check.py) for a no-download import and signature check that confirms the installed package exposes the expected classes.

## What this sub-skill covers

- Text model-based metrics: `BERTScore`, `InfoLM`.
- Multimodal CLIP metrics: `CLIPScore`, `CLIPImageQualityAssessment`.
- Image feature/model metrics: `FrechetInceptionDistance`, `KernelInceptionDistance`, `InceptionScore`, `MemorizationInformedFrechetInceptionDistance`, `LearnedPerceptualImagePatchSimilarity`, `DeepImageStructureAndTextureSimilarity`, `ARNIQA`, `PerceptualPathLength`.
- Audio model-backed metrics: `DeepNoiseSuppressionMeanOpinionScore`, `NonIntrusiveSpeechQualityAssessment`.
- Video and facial/multimodal metrics: `VideoMultiMethodAssessmentFusion`, `LipVertexError`.

## Route elsewhere

- Read `../core-api/SKILL.md` for the shared Metric lifecycle, distributed sync, persistence, and Lightning logging.
- Read `../vision-detection-metrics/SKILL.md` for PSNR, SSIM, Dice, MeanIoU, mAP, and other non-model image/detection metrics.
- Read `../audio-text-metrics/SKILL.md` for SNR, PESQ, WER, ROUGE, BLEU, SacreBLEU, and Perplexity.
- Read `../collections-wrappers-plotting/SKILL.md` for MetricCollection, wrappers, trackers, and plotting.

## Quick use

1. Check whether the user actually needs a model-backed metric or only a simple tensor metric.
2. Decide which pretrained model, tokenizer, or feature extractor to use, and whether a cache is already available.
3. Check whether the requested environment can satisfy downloads, device placement, and memory use.
4. Prefer no-download import/signature checks when you only need to document or inspect the API.

## Fast checks

- `python scripts/model_based_import_check.py`
- `python -c "from torchmetrics.text import BERTScore; import inspect; print(inspect.signature(BERTScore.__init__))"`

## Common signals

- `model_name_or_path`, `model`, `user_tokenizer`, `user_forward_fn`, `baseline_path`, `baseline_url`, `rescale_with_baseline`, `truncation` -> BERTScore or InfoLM
- `CLIPScore`, `CLIPImageQualityAssessment`, `openai/clip-...` -> CLIP metrics
- `torch_fidelity`, `feature extractor`, `InceptionScore`, `FID`, `KID` -> image feature metrics
- `piq`, `torchvision` weights, `LPIPS`, `DISTS`, `ARNIQA`, `PerceptualPathLength` -> image model-based metrics
- `librosa`, `onnxruntime`, `requests`, `DNSMOS`, `NISQA` -> audio model-based metrics
- `vmaf_torch`, `VideoMultiMethodAssessmentFusion` -> video quality metric

Files in this skill

  • SKILL.md3.5 KB
  • references/model-based-api.md5.1 KB
  • references/model-based-workflows.md3.2 KB
  • references/troubleshooting.md2 KB
  • scripts/model_based_import_check.py3.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.