image
Skill75 starsChanged 4 months agoMITView on GitHub
Canonical ImageNet eval preprocessing — square 256×256 resize → 224 center crop → ImageNet mean/std — for CV experiments probing ImageNet-pretrained backbones (ResNet, ViT, VGG, EfficientNet). Use this skill whenever a `torchvision.transforms` / `PIL` pipeline is being written, audited, or debugged for inference-time eval: feature extraction, activation hooks, mechanistic interpretability, top-k-activating-image retrieval, neuron labeling, or reproducibility checks. Apply it even when the user does not say "preprocessing" — triggers include `Resize`, `CenterCrop`, `T.Compose`, "ImageNet eval", "my activations changed between runs", or "results differ from the paper". Covers the `Resize(256)` (int, short-side) vs `Resize((256, 256))` (tuple, square) trap.
50 other projects use a version of this.
Adopted by
Most recently taken up by
- ansvisor/ansvisortheir own version, first seen Nov 8, 2026
- guaardvark/guaardvarktheir own version, first seen Nov 5, 2026
- shipshitdev/skillstheir own version, first seen Nov 1, 2026
- GAPZ787/claude-skillstheir own version, first seen Nov 1, 2026
- LOGIN-TB/hermes-toolboxtheir own version, first seen Nov 1, 2026
- LOGIN-TB/claude-skillstheir own version, first seen Oct 29, 2026
Used with
Projects with it also use popups, free-tools and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
CesarjoquinSkillpopups
When the user wants to create or optimize popups, modals, overlays, slide-ins, or banners for conversion purposes. Also use when the user mentions "exit intent," "popup conversions," "modal optimization," "lead capture popup," "email popup," "announcement banner," "overlay," "collect emails with a popup," "exit popup," "scroll trigger," "sticky bar," or "notification bar." Use this for any overlay or interrupt-style conversion element. For forms outside of popups, see cro. For general page conversion optimization, see cro.
Also in 16 projects that use this
CesarjoquinSkillfree-tools
When the user wants to plan, evaluate, or build a free tool for marketing purposes — lead generation, SEO value, or brand awareness. Also use when the user mentions "engineering as marketing," "free tool," "marketing tool," "calculator," "generator," "interactive tool," "lead gen tool," "build a tool for leads," "free resource," "ROI calculator," "grader tool," "audit tool," "should I build a free tool," or "tools for lead gen." Use this whenever someone wants to build something useful and give it away to attract leads or earn links. For downloadable content lead magnets (ebooks, checklists, templates), see lead-magnets.
Also in 17 projects that use this
coreyhaines31Skillmarketing-council
When the user wants multiple expert perspectives on a marketing question — a simulated board of advisors staffed by legendary marketers (Seth Godin, David Ogilvy, Eugene Schwartz, April Dunford, Rory Sutherland, Alex Hormozi, Byron Sharp, and more). Also use when the user mentions 'marketing council,' 'board of advisors,' 'advisory board,' 'what would Seth Godin say,' 'what would Ogilvy think,' 'channel Hormozi,' 'get multiple perspectives,' 'debate this,' 'have the council review,' 'marketing mentors,' or asks how a famous marketer would approach their problem. The council gives each advisor's take through their documented frameworks, surfaces where they disagree, and synthesizes a recommendation. For executing the winning direction, hand off to positioning, offers, copywriting, ads, or the relevant skill.
Also in 11 projects that use this
roerohanSkillprospecting
When the user wants to find, qualify, and build a list of prospects to reach out to — across B2B SaaS, general B2B, or local small businesses. Also use when the user mentions "prospecting," "build a prospect list," "find prospects," "find leads," "lead gen list," "find SaaS companies that," "find B2B companies," "find local businesses," "ICP-fit accounts," "who should we go after," "outbound list," "target account list," "find clients near me," "businesses without websites," "prospect research," "qualified leads," "find my first customers," "early adopters," "design partners," "beta users," or "who has this problem." Use this for the list-building and qualification phase. For writing the outbound copy after the list is built, see cold-email. For deep competitive research on specific accounts, see competitor-profiling.
Also in 16 projects that use this
coreyhaines31Skillmarketing-loops
When the user wants to set up a recurring, self-running marketing workflow — a repeatable loop an AI agent runs on a cadence (weekly, daily, on a trigger) rather than a one-off task. Also use when the user mentions 'marketing loop,' 'recurring marketing workflow,' 'automate my marketing,' 'marketing on autopilot,' 'weekly marketing review,' 'ad fatigue check,' 'weekly ads check,' 'content refresh loop,' 'churn watch,' 'ranking drop alert,' 'run my SEO,' 'SEO operator,' 'daily SEO agent,' 'run my outbound,' 'AI SDR,' 'reply triage,' 'always-on marketing,' 'marketing automation workflow,' or 'run this every week.' Use this to pick, adapt, and schedule an ongoing marketing loop that orchestrates the other marketing skills. For one-off marketing ideas, see marketing-ideas. For the experimentation loop specifically, see ab-testing.
Also in 9 projects that use this
- +7 more from Cesarjoquin
Other versions50 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 50
- coreyhaines31/marketingskills★ 59ksame name
- vercel-labs/json-render★ 19ksame name
- Nexus-JPF/note-companion★ 874same name
- wentorai/Research-Claw★ 858same name
- smixs/visual-skills★ 635same name
- guaardvark/guaardvark★ 306same name
- ansvisor/ansvisor★ 233same name
- Cesarjoquin/Marketing-Skills★ 190same name
- LOGIN-TB/claude-skills★ 82same name
- Rylaispirit/rylai-codex-hermes-skills★ 56same name
40 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository52 other files it gives its agents.
- ablation-plannerSkill
- analyze-resultsSkill
- arxivSkill
- auto-claimSkill
- auto-experimentSkill
- auto-iteration-loopSkill
- autoSkill
- verify-pick-alternativesSkill
- auto-verifySkill
- data-ruleSkill
- experiment-auditSkill
- experiment-planSkill
- experiment-queueSkill
- finetune-hyperparameter-sweepSkill
- multiple-choice-evaluationSkill
- experiment-tipsSkill
- steering-block-selectionSkill
- steering-coefficient-tuningSkill
- hypothesis-batchSkill
- idea-creatorSkill
- impact-checkSkill
- mechanic-db-searchSkill
- mechanism-auditSkill
- mechanism-behavior-discoverySkill
- mechanism-exploreSkill
- causal-attributionSkill
- CircuitSkill
- Feature Dictionary LearningSkill
- gradient-detectionSkill
- Magnitude AnalysisSkill
- Multi-Modal InterpretabilitySkill
- Neural Feature LearningSkill
- ProbingSkill
- Representation and Parameter AnalysisSkill
- SHAPSkill
- mechanism-skillsSkill
- Vocabulary ProjectionSkill
- mguideSkill
- mhistorySkill
- monitor-experimentSkill
- msearchSkill
- next-roundSkill
- notifySkill
- novelty-checkSkill
- paper-figureSkill
- research-litSkill
- research-refine-pipelineSkill
- research-refineSkill
- research-reviewSkill
- result-to-claimSkill
- run-experimentSkill
- training-checkSkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 2 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 43 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 44
After the subsequent T.CenterCrop(224), the two pipelines extract different patches from any non-square image.
- Distinctive: line 87
When patching, leave a one-line comment so the next reader knows the choice is deliberate:
- Distinctive: line 95
If a paper just says "ImageNet preprocessing" with no further detail, two defaults are reasonable:
- Very specific: line 97
Use the model's own image_processor / transforms() when reporting accuracy with its trained weights — that matches what the model was …
- Very specific: line 98
Use this skill's imagenet_eval_transform when doing mechanistic probing on top of a frozen backbone — that gives every architecture the …
“Common” is measured: kept by at least 6 in 10 of the 43 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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.
Why square resize (and when another convention is correct)
Square resize forces every input into a deterministic, source-aspect-agnostic 224×224 patch. That property is what you usually want for:
- Reproducibility across heterogeneous datasets (the same recipe works for portrait, landscape, and square inputs).
- Cross-architecture comparisons where ResNet, ViT, VGG, and EfficientNet should see exactly the same pixels.
- Hooked activation collection where rank stability of top-k matters more than honouring source aspect ratio.
Three other conventions are also legitimate; the choice between them is intentional, not a default:
| Convention | Pipeline | Use when |
| Square 256→224 (this skill) | Resize((256, 256)) + CenterCrop(224) + ImageNet mean/std | Probing a frozen ImageNet backbone for interpretability / concept work. |
| Classic ResNet | Resize(256) + CenterCrop(224) + ImageNet mean/std | Reproducing a pre-2022 paper that explicitly used short-side 256. |
| torchvision V2 weights | Resize(232) + CenterCrop(224) + ImageNet mean/std | Reproducing the accuracy reported for *_Weights.IMAGENET1K_V2. |
| CLIP image tower | Resize(224, BICUBIC) + CenterCrop(224) + CLIP mean [0.48145, 0.45783, 0.40821] std [0.26863, 0.26130, 0.27578] | Feeding a CLIP encoder. Mixing ImageNet stats into a CLIP encoder is a different bug class with the same shape. |
How to apply
New experiment
Paste imagenet_eval_transform into a data_utils.py (or equivalent) and pass it to your Dataset / DataLoader. Do this as the default for any ImageNet probing pipeline; reach for a different convention only if the row in the table above motivates it.
Audit an existing repo
Run:
grep -rn "Resize\|CenterCrop\|RandomCrop\|transforms\.\|image_processor" experiments/For each hit, decide based on the call:
T.Resize(256)/T.Resize(size=256)— short-side resize. If the experiment intends the square-resize convention, patch toT.Resize((256, 256), antialias=True). If the experiment intends classic ResNet eval, leave it but document the intent.T.Resize((256, 256))— already square; leave alone.T.Resize(232)paired withIMAGENET1K_V2weights — intentional torchvision V2 reproduction; do not change without a reason.- HF
image_processor(...)or timmresolve_data_config(...)— model's own native pipeline. This skill does not apply; overriding it can break the input distribution the model was trained on. RandomResizedCrop/RandomHorizontalFlipin an eval-time pass — likely a training-augmentation transform leaking into eval. Investigate.
When patching, leave a one-line comment so the next reader knows the choice is deliberate:
T.Resize((256, 256), antialias=True), # square resize per skills/imagePick a convention when the paper is silent
If a paper just says "ImageNet preprocessing" with no further detail, two defaults are reasonable:
- Use the model's own
image_processor/transforms()when reporting accuracy with its trained weights — that matches what the model was evaluated on. - Use this skill's
imagenet_eval_transformwhen doing mechanistic probing on top of a frozen backbone — that gives every architecture the same pixels.
Surface the ambiguity rather than picking silently. The two pipelines diverge on non-square images, and the divergence only becomes visible downstream, often after a wasted run.
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
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.

