Skip to content

Vision Model Trainer

Fine-tune object detection, image classification, and SAM segmentation models on Hugging Face cloud GPUs.

Stars
11,253
Licence
Apache-2.0
Files
12 files

What it does

Once installed, the agent can set up and launch training runs for computer-vision models: detectors that find and box objects in images, classifiers that label whole images, and SAM/SAM2 models that produce masks from box or point prompts. It checks your dataset format first with a helper script, then writes and submits a training job to Hugging Face Jobs (paid cloud GPUs), and saves the finished model to your Hugging Face Hub account. It also includes a cost estimator and guidance on hardware, timeouts, and monitoring.

Great for

  • Developers who want to fine-tune a detector or classifier on their own labelled images without managing a GPU
  • Teams with a COCO-style or Hub-hosted image dataset that need a repeatable training pipeline
  • People already paying for a Hugging Face Pro, Team or Enterprise plan who want to run Jobs

Skip it if

  • Anyone without a paid Hugging Face plan, since the skill relies on Jobs which require one (the skill itself is free to read)
  • Language-model or text fine-tuning, which the skill says belongs to a different skill (TRL-based training)
  • Sensitive or private images that you do not want uploaded to a cloud provider and the Hub, since the training runs remotely and results are pushed to the Hub

Try asking

  • “Fine-tune D-FINE or RT-DETR v2 on my COCO-format dataset of product photos and push the model to my Hub account”
  • “Train a MobileNetV3 image classifier on my folder of labelled plant images and estimate the cost first”
  • “Fine-tune SAM2 on my image matting dataset using bounding box prompts”
  • “Check whether my Hub dataset is in the right format for object detection before I spend GPU money”
Step-by-step guide: how to use Vision Model TrainerInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 12 original files, the Apache-2.0 licence and an attribution note.

    huggingface-vision-trainer.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip huggingface-vision-trainer.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip huggingface-vision-trainer.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Run the dataset inspector before any GPU training on an unfamiliar dataset; it reads metadata through the Datasets Server API and needs no download
  • Set the job timeout well above expected training time, since the skill warns the 30-minute default is too short, and use estimate_cost.py first to budget
  • Review the generated training script and confirm the Hub push target and token handling before submitting a paid job

What's inside

  • references/finetune_sam2_trainer.md
  • references/hub_saving.md
  • references/image_classification_training_notebook.md
  • references/object_detection_training_notebook.md
  • references/reliability_principles.md
  • references/timm_trainer.md
  • scripts/dataset_inspector.py
  • scripts/estimate_cost.py
  • scripts/image_classification_training.py
  • scripts/object_detection_training.py
  • scripts/sam_segmentation_training.py
  • SKILL.md

Redistributed unmodified from huggingface/skills under the Apache-2.0 licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.