Hugging Face Vision Trainer Skill · Data Ai

Automated Vision Model Training on Hugging Face Jobs

Fine-tune 4+ types of vision models including SAM2 and RT-DETR on managed cloud GPUs.

Automate your Hugging Face Jobs workflow and save results to the Hub today.

  • Computer Vision
  • Hugging Face
  • Cloud GPU
  • SAM2
  • Object Detection

About This Skill

Master computer vision with support for 4 object detection architectures and seamless SAM2 segmentation. This skill automates training on Hugging Face Jobs, ensuring your models are saved directly to the Hub.

Quick Start

  1. 1Authenticate with Hugging Face Hub
  2. 2Select a vision model architecture
  3. 3Configure your dataset and hardware
  4. 4Launch the training job
Example Command
uv run scripts/estimate_cost.py --dataset my-user/my-vision-data

Core Capabilities

Fine-tune object detection models

Support for D-FINE, RT-DETR v2, DETR, and YOLOS on cloud GPUs or local environments.

Fine-tune image classification models

Leverage timm backends like MobileNetV3 and ResNet or any Transformers-based classifier.

Fine-tune SAM or SAM2 models

Optimize Segment Anything Models for segmentation and image matting using bbox or point prompts.

Run vision training jobs on Hugging Face Jobs

Execute managed training jobs with automatic result persistence to the Hugging Face Hub.

Usage Examples

Input

Fine-tune a ResNet50 model on my custom dataset.

Output

Launching Hugging Face Job for image classification using timm:resnet50.

Before

Manual local training setup with complex GPU driver issues.

After

Automated cloud training with results saved directly to the Hub.

Input

Estimate the cost for training RT-DETR.

Output

Running cost estimation script for RT-DETR on A100 hardware.

SKILL.md

---
source: "https://github.com/huggingface/skills/tree/main/skills/huggingface-vision-trainer"
name: hugging-face-vision-trainer
description: Train or fine-tune vision models on Hugging Face Jobs for detection, classification, and SAM or SAM2 segmentation.
risk: unknown
---

# 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.

## 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

## Related Skills

- **`hugging-face-jobs`** — General HF Jobs infrastructure: token authentication, hardware flavors, timeout management, cost estimation, secrets, environment variables, scheduled jobs, and result persistence. **Refer to the Jobs skill for any non-training-specific Jobs questions** (e.g., "how do secrets work?", "what hardware is available?", "how do I pass tokens?").
- **`hugging-face-model-trainer`** — TRL-based language model training (SFT, DPO, GRPO). Use that skill for text/language model fine-tuning.

## Local Script Execution

Helper scripts use PEP 723 inline dependencies. Run them with `uv run`:
```bash
uv run scripts/dataset_inspector.py --dataset username/dataset-name --split train
uv run scripts/estimate_cost.py --help
```

## Prerequisites Checklist

Before starting 

Frequently Asked Questions

FAQ

Which tools are compatible with this skill?
This skill is compatible with Hugging Face Jobs, the Transformers library, timm, and the uv package manager for script execution.
Who is the target audience for this skill?
It is designed for AI developers and computer vision engineers who want to automate model training on cloud infrastructure.
How does this differ from alternatives like local training?
Unlike local training, this skill leverages Hugging Face Jobs' managed GPUs, removing the need for local hardware setup and ensuring persistence.
What language support is available?
The training scripts are written in Python and utilize PEP 723 for dependency management, making them cross-platform compatible.
What are the expected results after training?
Upon completion, your fine-tuned vision model is automatically uploaded to your Hugging Face Hub repository for immediate deployment.

Discussion

Discussion

0 comments
U

Trigger Phrases

Use these phrases to activate this skill in your AI coding assistant:

Fine-tune SAM2Train object detectionCloud vision trainingHugging Face Jobs visionFine-tune image classifier
Hugging Face Vision Trainer AI Agent Skill for Developers