Agent skill

Anomalib Training

by open-edge-platform in open-edge-platform/anomalib

Trains an anomalib model on a dataset via the Python API or CLI, including training on a custom folder-structured dataset with the Folder datamodule.

Apache-2.0Auto-check passedDevelopment

Install Anomalib Training

skills CLI
$ npx skills add open-edge-platform/anomalib --skill anomalib-training -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install open-edge-platform/anomalib anomalib-training --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/open-edge-platform/anomalib.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/anomalib-training .claude/skills/anomalib-training && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
anomalib-training
GitHub stars
6.2k
Token cost
~1.4k tokens
SKILL.md length
360 words
Files
2
Skills in repo
17
Repo updated
First seen
Licence
Apache-2.0

At a glance

Trains an anomalib model on a dataset via the Python API or CLI, including training on a custom folder-structured dataset with the Folder datamodule.

  • Debugging an anomalib training script/command
  • SKILL.md covers Python API — standard…, Python API — custom data with…, CLI and Choosing accelerator / devices, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Choosing Engine/Trainer arguments

What it does

Anomalib Training is an agent skill from open-edge-platform/anomalib. Trains an anomalib model on a dataset via the Python API or CLI, including training on a custom folder-structured dataset with the Folder datamodule. Use when writing or debugging an anomalib training script/command, choosing Engine/Trainer arguments, or wiring a model + datamodule together. Do not use for adding a new model or datamodule from scratch (see anomalib-adding-a-model / anomalib-adding-a-datamodule), or for the tiled-ensemble or benchmarking pipelines (see anomalib-tiled-ensemble /…

Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `evals/evals.json`).

It sits in Development. It works with Python. The repository describes itself as: An anomaly detection library comprising state-of-the-art algorithms and features such as experiment management, hyper-parameter optimization, and edge inference. The licence is Apache-2.0.

When your agent uses it

  • Debugging an anomalib training script/command
  • Choosing Engine/Trainer arguments
  • Wiring a model + datamodule together
  • Adding a new model

Example prompts

  • “Use the anomalib-training skill to train an anomalib model on a dataset via the Python API or CLI, including training on a custom folder-structured…”
  • “/anomalib-training”

Requirements

  • Python 3

What it can do on your machine

Read from SKILL.md and the folder at commit dc087d5. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python and bash).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Anomalib Training loads about 1.4k tokens when it runs. Until then it costs about 135 tokens; SKILL.md has 360 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~135
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from open-edge-platform/anomalib at commit dc087d5, republished under its Apache-2.0 licence (© open-edge-platform). 360 words, ~1,427 tokens.

Download SKILL.mdSave it as .claude/skills/anomalib-training/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
anomalib-training
description
Trains an anomalib model on a dataset via the Python API or CLI, including training on a custom folder-structured dataset with the Folder datamodule. Use when writing or debugging an anomalib training script/command, choosing Engine/Trainer arguments, or wiring a model + datamodule together. Do not use for adding a new model or datamodule from scratch (see anomalib-adding-a-model / anomalib-adding-a-datamodule), or for the tiled-ensemble or benchmarking pipelines (see anomalib-tiled-ensemble / anomalib-benchmarking).
license
Apache-2.0

Training a Model on a Dataset

Training in anomalib always goes through anomalib.engine.Engine, which wraps a Lightning Trainer.

Python API — standard benchmark dataset (MVTecAD)

python
from anomalib.data import MVTecAD
from anomalib.models import Patchcore
from anomalib.engine import Engine

datamodule = MVTecAD(root="./datasets/MVTecAD", category="bottle", train_batch_size=32)
model = Patchcore()
engine = Engine()                      # any Lightning Trainer kwarg can go here
engine.fit(model=model, datamodule=datamodule)
results = engine.test(model=model, datamodule=datamodule)

Engine(**kwargs) forwards unknown kwargs straight to the underlying Lightning Trainer (accelerator, devices, strategy, max_epochs, logger, callbacks, enable_checkpointing, val_check_interval, barebones, ...) — there is no separate "Trainer config object" to build.

Key Engine methods: fit(model, datamodule=...), train(...) (fit + test in one call), test(model=None, datamodule=...), predict(model=None, datamodule=..., dataset=..., data_path=...). If model/datamodule are omitted from test/predict, the engine reuses the ones passed to fit.

Python API — custom data with the Folder datamodule

Use Folder whenever your data is laid out as root/normal_dir/*, root/abnormal_dir/*, and optionally root/mask_dir/* (segmentation masks) — no new dataset code needed:

python
from anomalib.data import Folder
from anomalib.models import Padim
from anomalib.engine import Engine

datamodule = Folder(
    name="custom",             # required — used as the datamodule's display name
    root="./datasets/custom",
    normal_dir="good",         # required
    abnormal_dir="defect",     # optional: enables anomalous test/eval samples
    mask_dir="mask",           # optional: enables pixel-level (segmentation) evaluation
    train_batch_size=32,
    eval_batch_size=32,
    num_workers=8,
)
model = Padim()
engine = Engine()
engine.fit(model=model, datamodule=datamodule)

If you only have normal training images and unlabeled/normal-only test images, omit abnormal_dir and mask_dir — Folder will still produce a valid train/test split via test_split_ratio (fraction of normal training images held out for testing). Use normal_test_dir if you have a separate directory of normal images specifically for the test set.

CLI

bash
# Standard dataset, defaults
anomalib train --model Patchcore --data anomalib.data.MVTecAD

# Override a datamodule field
anomalib train --model Patchcore --data anomalib.data.MVTecAD --data.category transistor

# Override a trainer field (use a gradient-trained model like Stfpm where max_epochs is meaningful)
anomalib train --model anomalib.models.Stfpm --data anomalib.data.MVTecAD --trainer.max_epochs 3

# Custom Folder dataset from the CLI
anomalib train --model Padim --data anomalib.data.Folder \
  --data.name custom --data.root ./datasets/custom \
  --data.normal_dir good --data.abnormal_dir defect

# From a config file (jsonargparse; combine with any of the above overrides)
anomalib train --config path/to/config.yaml

CLI wiring lives in src/anomalib/cli/cli.py (AnomalibCLI); model/data classes are exposed as jsonargparse subclass arguments, so --model/--data accept either a short name (Padim) or a full class path (anomalib.models.Padim, anomalib.data.Folder).

Choosing accelerator / devices

Pass standard Lightning kwargs to Engine(...): accelerator="gpu"|"cpu"|"xpu", devices=1. For Intel XPU specifically, use SingleXPUStrategy/XPUAccelerator from anomalib.engine:

python
from anomalib.engine import Engine, SingleXPUStrategy, XPUAccelerator
engine = Engine(strategy=SingleXPUStrategy(), accelerator=XPUAccelerator())
Show full SKILL.md (149 more words)Show less

Gotchas

  • Not every model trains via gradient descent — training-free models (e.g. Padim, Patchcore) still go through engine.fit(...); Engine/Trainer handles the single "epoch" needed to build their memory bank. You don't need special-case code for this. Note that these models override max_epochs via their trainer_arguments property (e.g. max_epochs=1), so any max_epochs you pass to Engine will be overwritten for such models.
  • Folder's mask_dir is what switches evaluation from image-level (classification) to pixel-level (segmentation) metrics — only pass it if you actually have per-pixel ground-truth masks.
  • Results (checkpoints, logs, images) are written under Engine's default_root_dir ("results" by default), nested by model/datamodule/category — check there first when debugging a run.

Reviewer / self-check

  • Engine(...) receives Trainer overrides as plain kwargs, not a hand-built Trainer object.
  • Folder-dataset training specifies normal_dir and, if applicable, abnormal_dir/mask_dir matching the actual on-disk layout.
  • CLI invocations use anomalib.data.<Class> / anomalib.models.<Class> paths that are actually exported (see anomalib-adding-a-model / anomalib-adding-a-datamodule for how exports work).

© open-edge-platform, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in .agents/skills/anomalib-training of open-edge-platform/anomalib.

  • SKILL.md
  • evals/evals.json

Open the folder on GitHubat commit dc087d5

Compare with similar skills

Anomalib Training next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Anomalib Training compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Anomalib Training this skillopen-edge-platform/anomalib6.2k—~1.4kAutomated safety check: PassApache-2.0
Code Review ChecklistshareAI-lab/learn-claude-code78k5 repos~1.1kAutomated safety check: PassMIT
Minimizing Ty Ecosystem Changesastral-sh/ruff50k—~4.6kAutomated safety check: PassMIT
Merge Dependabot PRsonyx-dot-app/onyx32k1 repos~2.2kAutomated safety check: PassMIT
Summarise Ecosystem Resultsastral-sh/ruff50k—~2.2kAutomated safety check: PassMIT
Senior Architect Toolkitmaslennikov-ig/claude-code-orchestrator-kit2608 repos~1.2kAutomated safety check: NotesCustom licence

Similar skills

  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 5 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Official

    A skill your agent uses when a user says "minimize this ty ecosystem change", "reproduce this ecosystem result", "investigate a primer difference", "investigate a mypyprimer difference"…

    50k GitHub stars~4.6k tokensUpdated today
    DevelopmentAuto-check passed
  • Merge Dependabot PRs

    onyx-dot-app/onyx

    Triages and lands a batch of open Dependabot PRs in the Onyx repo, where main is gated exclusively by GitHub's merge queue: approves and enqueues green PRs, closes superseded duplicates, fixes…

    32k GitHub starsUsed in 1 repo~2.2k tokens
    DevelopmentAuto-check passed
  • Official

    A skill your agent uses when a user says "summarise ecosystem results", "summarize this ty ecosystem report", "what changed in this ecosystem run?", or asks to summarise or summarize ty ecosystem…

    50k GitHub stars~2.2k tokensUpdated today
    DevelopmentAuto-check passed
  • Senior Architect Toolkit

    maslennikov-ig/claude-code-orchestrator-kit

    Comprehensive software architecture skill for designing scalable, maintainable systems using ReactJS, NextJS, NodeJS, Express, React Native, Swift, Kotlin…

    260 GitHub starsUsed in 8 repos~1.2k tokens
    DevelopmentAuto-check: notes
  • Kedro Babysit

    kedro-org/kedro

    Run Kedro's local lint / format / type-check / tests on changed files (uses the project's pre-commit hooks, ruff, mypy, pytest, lint-imports, detect-secrets, Make targets — in the right venv), or…

    11k GitHub stars~4k tokensUpdated today
    DevelopmentAuto-check passed

More from open-edge-platform/anomalib

All 17 skills in this repo
  • Anomalib Adding A Model

    open-edge-platform/anomalib

    Adds a new anomaly-detection model to anomalib under src/anomalib/models/.

    6.2k GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • Anomalib Benchmarking

    open-edge-platform/anomalib

    Runs the anomalib benchmarking pipeline to train/evaluate a grid of model + dataset (+ category) combinations and collect metrics into a results CSV.

    6.2k GitHub stars~1k tokensUpdated today
    Auto-check passed
  • Anomalib Tiled Ensemble

    open-edge-platform/anomalib

    Runs and configures the anomalib tiled-ensemble pipeline, which trains/evaluates one model per image tile and merges results (with optional seam smoothing) for high-resolution anomaly detection.

    6.2k GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Model Sample Image Export

    open-edge-platform/anomalib

    Export, validate, and publish model sample-result images into docs/source/images and reference them from README/docs pages.

    6.2k GitHub stars~874 tokensUpdated today
    Auto-check passed
  • UI Test Utils

    open-edge-platform/anomalib

    A skill your agent uses when writing or updating Anomalib Studio UI component or hook tests that need the shared render/renderHook helpers, React Router paths or parameters, React Query, theme…

    6.2k GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • Anomalib Adding A Datamodule

    open-edge-platform/anomalib

    Adds a new dataset/datamodule to anomalib under src/anomalib/data/.

    6.2k GitHub stars~5.1k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Anomalib Training

What does Anomalib Training do?

Trains an anomalib model on a dataset via the Python API or CLI, including training on a custom folder-structured dataset with the Folder datamodule. Anomalib Training is an agent skill from open-edge-platform/anomalib. Trains an anomalib model on a dataset via the Python API or CLI, including training on a custom folder-structured dataset with the Folder datamodule.

When should I use Anomalib Training?

Anomalib Training fits situations like: debugging an anomalib training script/command; choosing Engine/Trainer arguments; wiring a model + datamodule together; adding a new model.

How do I install Anomalib Training in Claude Code?

Run `npx skills add open-edge-platform/anomalib --skill anomalib-training -a claude-code`. Or copy the skill folder (.agents/skills/anomalib-training in open-edge-platform/anomalib) into .claude/skills/anomalib-training in your project. Claude Code loads it when a task matches its description.

How do I install Anomalib Training in Codex?

Run `npx skills add open-edge-platform/anomalib --skill anomalib-training -a codex`. Or copy the skill folder (.agents/skills/anomalib-training in open-edge-platform/anomalib) into .agents/skills/anomalib-training in your project. Codex loads it when a task matches its description.

Can I use Anomalib Training in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add open-edge-platform/anomalib --skill anomalib-training -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/anomalib-training, .gemini/skills/anomalib-training, .github/skills/anomalib-training and .opencode/skills/anomalib-training in your project.

What does Anomalib Training need to run?

SKILL.md names no scripts, command-line tools or credentials: Anomalib Training is instructions for the agent only. Our summary lists: Python 3.

Does Anomalib Training access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Anomalib Training safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Anomalib Training use?

Anomalib Training is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Anomalib Training use?

About 1.4k tokens (SKILL.md is roughly 5.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Anomalib Training?

Skills that share tags, products or a category with Anomalib Training: Code Review Checklist (shareAI-lab/learn-claude-code, 78k stars), Minimizing Ty Ecosystem Changes (astral-sh/ruff, 50k stars), Merge Dependabot PRs (onyx-dot-app/onyx, 32k stars) and Summarise Ecosystem Results (astral-sh/ruff, 50k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Anomalib Training?

open-edge-platform (a GitHub organization) maintains it in open-edge-platform/anomalib, which has 6,230 GitHub stars. The repository holds 17 skills in this directory. The repository was last updated on October 8, 2026.

Source: open-edge-platform/anomalib on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.