agentleFS
open-edge-platformopen-edge-platform/skills/.agents/skills/anomalib-benchmarking/SKILL.md

anomalib-benchmarking

Skill8 starsChanged 7 days agoApache-2.0View on GitHub

Runs the anomalib benchmarking pipeline to train/evaluate a grid of model + dataset (+ category) combinations and collect metrics into a results CSV. Use when comparing multiple models/datasets/categories in one sweep, or authoring/editing a benchmark config YAML. Do not use for training a single model (see anomalib-training) or the tiled-ensemble pipeline (see anomalib-tiled-ensemble). For turning measured results into README/docs benchmark tables, see the benchmark-and-docs-refresh skill.

1 other project uses a version of this.

Adopted by

Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data

Week of Sep 13: 0 new projectsWeek of Sep 20: 0 new projectsWeek of Sep 27: 0 new projectsWeek of Oct 4: 0 new projectsWeek of Oct 11: 0 new projectsWeek of Oct 18: 0 new projectsWeek of Oct 25: 0 new projectsWeek of Nov 1: 0 new projects
Sep 2026Oct 2026Nov 2026
New projects taking a version of this file each week, over the 8 weeks our latest run read: only 0 in all, so this is a hint, not a trend.

Most recently taken up by

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Never hand-write or infer numbers into README/docs benchmark tables — always source them from a results.csv produced by an actual run of …

    line 90

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Using the Benchmarking Pipeline

The benchmarking pipeline runs a grid of model/dataset/category combinations end-to-end (train + test) and writes measured metrics to a CSV — use it to produce real, reproducible numbers rather than hand-editing benchmark tables.

Code locations

  • src/anomalib/pipelines/benchmark/pipeline.py — Benchmark: top-level pipeline; picks SerialRunner or ParallelRunner based on configured accelerators and torch.cuda.device_count().
  • src/anomalib/pipelines/benchmark/generator.py — BenchmarkJobGenerator: expands the config (including grid: entries) into individual jobs.
  • src/anomalib/pipelines/benchmark/job.py — BenchmarkJob: runs one model/dataset combination, times it, and saves results.
  • tools/experimental/benchmarking/benchmark.py — thin CLI wrapper around Benchmark.
  • tools/experimental/benchmarking/sample.yaml — example config to copy from.

Running it

# Via the tools wrapper
python tools/experimental/benchmarking/benchmark.py --config tools/experimental/benchmarking/sample.yaml

# Via the anomalib CLI (registered pipeline subcommand)
anomalib benchmark --config tools/experimental/benchmarking/sample.yaml

Config structure

accelerator:
  - cuda
  - cpu

benchmark:
  seed: 42
  model:
    class_path:
      grid: [Padim, Patchcore]
  data:
    class_path: MVTecAD
    init_args:
      category:
        grid:
          - bottle
          - capsule

Any field can use grid: [...] to sweep multiple values — the generator produces the Cartesian product of every grid field as separate jobs (here: 2 models × 2 categories = 4 jobs). Non-grid fields are held constant across all jobs. data.class_path / model.class_path follow the same anomalib.data.* / anomalib.models.* resolution as everywhere else in the repo (see anomalib-training).

Where results go

BenchmarkJob.save(...) writes one row per job into:

runs/benchmark/<timestamp>/results.csv

(<timestamp> is generated when results are saved via BenchmarkJob.save(), e.g. 2026-08-24-10_30_00.) Each row includes the model/dataset/category combination and the measured metrics — this is the file to consume when building or refreshing README/docs benchmark tables.

There is also a separate, narrower helper tools/benchmark_mebin.py that writes to results/mebin_benchmark.csv for a specific benchmarking use case — prefer the pipeline above unless you specifically need that script's behavior.

Gotchas

  • A grid sweep multiplies job count fast — check the Cartesian product size before launching a large sweep (e.g. 5 models × 10 categories = 50 full train+test runs).
  • accelerator: [cuda, cpu] creates one runner per entry, so every model/category combination runs once per accelerator (doubling the total job count). This is not a device-pool selector — if you only want to benchmark on GPU, use accelerator: [cuda].
  • Never hand-write or infer numbers into README/docs benchmark tables — always source them from a results.csv produced by an actual run of this pipeline.

Reviewer / self-check

  • Config's grid fields produce the intended, bounded set of jobs (no accidental huge sweep).
  • model.class_path / data.class_path values resolve to real exported classes.
  • Benchmark run completed and runs/benchmark/<timestamp>/results.csv exists before citing numbers anywhere else.
  • Test reference: tests/integration/pipelines/test_benchmark.py for how the pipeline is invoked programmatically if debugging job generation.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.