image

image is a skill for Claude Code, Codex from zjunlp/Mechanist. It costs 183 tokens per session (1,553 once invoked), scanned A, original, MIT.

The standard image preparation steps used when evaluating computer-vision models trained on ImageNet, a large image dataset. Images are resized, center-cropped, converted to numbers, and normalized to expected values.

In plain words
What is it for?
Use it when writing, checking, or debugging torchvision and PIL input pipelines for ImageNet-pretrained models such as ResNet or ViT.
Why use it?
It prevents small preprocessing differences from changing evaluation results or making a model appear better or worse than it is.

Skill for Claude CodeCodex

Part of the mechanist plugin — 54 skills, 4 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/zjunlp/mechanist/image
Any agent
npx skills add zjunlp/Mechanist --skill image
Clone the repo
git clone --depth 1 https://github.com/zjunlp/Mechanist

Made for: Claude Code, Codex.

Or install mechanist, the plugin that ships this one along with the rest of its 54 skills, 4 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for image

README.md
[![agentmods](https://agentmods.dev/badge/skills/zjunlp/mechanist/image.svg)](https://agentmods.dev/skills/zjunlp/mechanist/image)
Your own site
<a href="https://agentmods.dev/skills/zjunlp/mechanist/image"><img src="https://agentmods.dev/badge/skills/zjunlp/mechanist/image.svg" alt="Measured on agentmods" height="20"></a>
Per session 183 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,553 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00183 $0.01553
Opus 5 $0.00092 $0.00776
Sonnet 5 $0.00037 $0.00311
Haiku 4.5 $0.00018 $0.00155

Measured 4d ago against content hash 306b8328132e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

image scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/experiment-tips/image/SKILL.md · 101 lines

How it starts

The opening of the file, as written. The whole thing — 101 lines — stays where its author put it; the contents beside it link to each section on GitHub.

ImageNet Eval Preprocessing

Drop-in snippet

import torchvision.transforms as T

IMAGENET_MEAN = (0.485, 0.456, 0.406)
IMAGENET_STD  = (0.229, 0.224, 0.225)

def imagenet_eval_transform(crop: int = 224) -> T.Compose:
    """Canonical ImageNet eval preprocessing.

    Pipeline:
        1. Square resize to 256 x 256       (NOT short-side resize)
        2. Center crop to `crop` x `crop`   (default 224)
        3. ToTensor                          (RGB / 255 -> [0, 1])
        4. Normalize with ImageNet mean/std
    """
    return T.Compose([
        T.Resize((256, 256), antialias=True),   # tuple => square resize
        T.CenterCrop(crop),
        T.ToTensor(),
        T.Normalize(mean=IMAGENET_MEAN, std=IMAGENET_STD),
    ])

antialias=True is set explicitly because PIL inputs default to it but tensor inputs do not, and the explicit flag removes a version-dependent warning across torchvision ≥0.15.

The trap: Resize(256) vs Resize((256, 256))

Calling T.Resize with an int vs a tuple does two different things:

Call Behaviour A 500 × 800 input becomes
T.Resize(256) (int) Short-side resize, aspect ratio preserved 256 × 410
T.Resize((256, 256)) (tuple) Square resize, aspect ratio NOT preserved 256 × 256

After the subsequent T.CenterCrop(224), the two pipelines extract different patches from any non-square image. Most natural images (and most ImageNet validation images) are non-square, so the divergence applies to virtually the whole dataset.

For mechanistic interpretability and any work that ranks images by activation magnitude, this is a silent reproducibility hazard: the top-k maximally activating images set shifts when the crop shifts, which propagates to every downstream artefact — semantic embeddings, neuron labels, clarity / polysemanticity scores, faithfulness ablations. Numbers will look reasonable; they just will not match a reference pipeline that uses the other convention.

Read the full file on GitHub · 101 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 101 lines · 183 tokens per session scan A 306b8328132e

Subscribe to this mod's changes

image is a skill published in the GitHub repository zjunlp/Mechanist (51 stars, last pushed 8d ago), licensed MIT. It adds 183 tokens to every session and 1,553 once invoked, about $0.0009 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories