Agent skill · practicalswan

huggingface-vision-trainer

Trains and fine-tunes vision models for object detection (D-FINE, RT-DETR v2, DETR, YOLOS), image classification (timm models — MobileNetV3, MobileViT, ResNet, ViT/DINOv3 — plus any Transformers classifier), and SAM/SAM2 segmentation using Hugging Face Transformers on Hugging Face Jobs cloud GPUs. Covers COCO-format dataset preparation, Albumentations augmentation, mAP/mAR evaluation, accuracy metrics, SAM segmentation with bbox/point prompts, DiceCE loss, hardware selection, cost estimation, Trackio monitoring, and Hub persistence. Use when users mention training object detection, image classification, SAM, SAM2, segmentation, image matting, DETR, D-FINE, RT-DETR, ViT, timm, MobileNet, ResNet, bounding box models, or fine-tuning vision models on Hugging Face Jobs.

What it needs

About 10k tokens when loaded.

What this skill does

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 Local Script Execution Helper scripts use PEP 723 inline dependencies. Run them with uv run: 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 hfwhoami() (tool) or hf 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 objects column with bbox, category (and optionally area) 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 imageid column 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 image column (PIL images) and a label column (integer class IDs or strings) The label …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills practicalswan/huggingface-vision-trainer

View the source on GitHub

Browse the @skills marketplace