hugging-face-vision-trainer
Has your agent train vision models, like object detection and segmentation. It validates datasets and saves results to the Hugging Face Hub.
What it does
This tool trains AI models to understand images. It can learn to identify objects, classify images, or segment parts of an image, all using powerful cloud computers and automatically saving the results.
When to use it
- ✓When you want to teach AI to recognize specific objects in photos.
- ✓When you want AI to categorize images (e.g., cat, dog, car).
- ✓When you want to train AI to separate parts of an image, like a background.
Example of what to ask your AI
“Train a model to detect dogs in photos, using my dataset 'my-dog-dataset'.”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
You provide your image data and tell the AI what to learn (object detection, classification, or segmentation). The AI uses cloud computers to learn from your data and saves the trained model for you.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add sickn33/agentic-awesome-skills --skill hugging-face-vision-trainerOr download just the file:
curl -L https://raw.githubusercontent.com/sickn33/agentic-awesome-skills/main/plugins/agentic-awesome-skills-claude/skills/hugging-face-vision-trainer/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from GitHub.
Vision Model Training on Hugging Face Jobs
Train object detection, image classification, and SAM/SAM2 segmentation models on managed cloud GPUs. No local GPU setup required—results are automatically saved to the Hugging Face Hub.
Detailed Guide
Read the detailed guide before executing this skill. It retains the complete procedure and reference material. Treat its safety, prerequisites, and validation requirements as mandatory. For focused work, load the relevant sections; for end-to-end work, read the guide completely.
When to Use This Skill
Use this skill when users want to:
- Fine-tune object detection models (D-FINE, RT-DETR v2, DETR, YOLOS) on cloud GPUs or local
- Fine-tune image classification models (timm: MobileNetV3, MobileViT, ResNet, ViT/DINOv3, or any Transformers classifier) on cloud GPUs or local
- Fine-tune SAM or SAM2 models for segmentation / image matting using bbox or point prompts
- Train bounding-box detectors on custom datasets
- Train image classifiers on custom datasets
- Train segmentation models on custom mask datasets with prompts
- Run vision training jobs on Hugging Face Jobs infrastructure
- Ensure trained vision models are permanently saved to the Hub
Prerequisites Checklist
Before starting any training job, verify:
Account & Authentication
- Hugging Face Account with Pro, Team, or Enterprise plan (Jobs require paid plan)
- Authenticated login: Check with
hf_whoami()(tool) orhf auth whoami(terminal) - Token has write permissions
- MUST pass token in job secrets — see directive #3 below for syntax (MCP tool vs Python API)
Dataset Requirements — Object Detection
- Dataset must exist on Hub
- Annotations must use the
objectscolumn withbbox,category(and optionallyarea) sub-fields - Bboxes can be in xywh (COCO) or xyxy (Pascal VOC) format — auto-detected and converted
- Categories can be integers or strings — strings are auto-remapped to integer IDs
image_idcolumn is optional — generated automatically if missing- ALWAYS validate unknown datasets before GPU training (see Dataset Validation section)
Dataset Requirements — Image Classification
- Dataset must exist on Hub
- Must have an
imagecolumn (PIL images) and alabelcolumn (integer class IDs or strings) - The label column can be
ClassLabeltype (with names) or plain integers/strings — strings are auto-remapped - Common column names auto-detected:
label,labels,class,fine_label - ALWAYS validate unknown datasets before GPU training (see Dataset Validation section)
Dataset Requirements — SAM/SAM2 Segmentation
- Dataset must exist on Hub
- Must have an
imagecolumn (PIL images) and amaskcolumn (binary ground-truth segmentation mask) - Must have a prompt — either:
- A
promptcolumn with JSON containing{"bbox": [x0,y0,x1,y1]}or{"point": [x,y]} - OR a dedicated
bboxcolumn with[x0,y0,x1,y1]values - OR a dedicated
pointcolumn with[x,y]or[[x,y],...]values
- A
- Bboxes should be in xyxy format (absolute pixel coordinates)
- Example dataset:
merve/MicroMat-mini(image matting with bbox prompts) - ALWAYS validate unknown datasets before GPU training (see Dataset Validation section)
Critical Settings
- Timeout must exceed expected training time — Default 30min is TOO SHORT. See directive #6 for recommended values.
- Hub push must be enabled —
push_to_hub=True,hub_model_id="username/model-name", token insecrets
Limitations
- Use this skill only when the task clearly matches its upstream product or API scope.
- Verify commands, API behavior, pricing, quotas, credentials, and deployment effects against current official documentation before making changes.
- Do not treat generated examples as a substitute for environment-specific tests, security review, or user approval for destructive or costly actions.
FAQ
Do I need a powerful computer?
No, the training is done on powerful cloud computers (Hugging Face Jobs); you just need a paid Hugging Face account.
Where are the results saved?
The trained models are automatically saved to the Hugging Face Hub, an online place to share models.
Does my data need to be in a special format?
Yes, your image data needs to be organized on the Hugging Face Hub with specific annotations depending on what you want to train (object detection, classification, or segmentation).
Details
Original description by the author
Train object detection, image classification, and SAM or SAM2 segmentation models locally or on Hugging Face Jobs, with dataset validation and results saved to the Hub.
Popularity
- GitHub stars
- 48k
- Ranking position
- #3230
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
00-andruia-consultant
Helps your agent start or improve AI projects. It analyzes code, suggests tools, and creates action plans in Spanish.
sickn33/agentic-awesome-skills
007
Lets your agent perform security audits and threat modeling. It's useful for protecting projects against attacks and vulnerabilities.
sickn33/agentic-awesome-skills
10-andruia-skill-smith
Helps your agent create or improve AI tools. It defines how tools work, writes documentation, and validates the structure.
sickn33/agentic-awesome-skills
20-andruia-niche-intelligence
Lets your agent create a summary about a specific industry. It's useful for understanding the context, rules, usage patterns, and risks of a project, using reliable sources.
sickn33/agentic-awesome-skills
Similar skills
agent-architecture-audit
Makes your agent check if everything is working correctly. It finds and fixes problems in AI systems, ensuring they perform as expected.
affaan-m/ECC
agent-eval
Helps your agent compare different AI coding tools. It measures which one is faster, cheaper, and more reliable for specific tasks.
affaan-m/ECC
agent-harness-construction
Makes your agent better understand how to perform tasks. It optimizes the tools and instructions the agent uses to increase its chances of success.
affaan-m/ECC