SkillsReviewed · Hugging Face

Hugging Face Vision Trainer skill

An instruction skill for AI coding assistants that guides the fine-tuning of object detection, image classification and SAM/SAM2 segmentation models with the Transformers Trainer. It is cloud-first. Its main workflow sends training to Hugging Face Jobs, which needs a paid plan, but its reference documents also include direct Trainer examples that run outside Jobs. The catch is that its hardware prices and time estimates are hard-coded figures, and nothing in the evidence shows whether they match current pricing. Its dataset check is also only a rough first pass. It bundles a SKILL.md playbook, three training scripts, a dataset format inspector, a cost estimator and reference notebooks, and it pushes finished models to the Hugging Face Hub.

Researched 15 Nov 2026

In short.

This is an instruction skill for AI coding assistants. It walks a developer through fine-tuning vision models (object detection, image classification and SAM/SAM2 segmentation) with the Transformers Trainer. It is cloud-first. The main workflow sends training to Hugging Face Jobs cloud GPUs, which SKILL.md says require a Pro, Team or Enterprise plan, and the skill prices that compute per GPU hour. The object detection, image classification and SAM2 reference documents also contain direct Trainer training examples that do not use Jobs. Those carry no Jobs charges, but they need access to suitable compute, which may be local or hosted elsewhere; the object detection reference, for example, describes a run on a Google Colab T4 GPU. The cost of that compute is unknown. The skill suits people who have a dataset on the Hub. Subscription prices and total job costs are unknown. The skill's hourly prices and time estimates are hard-coded numbers, and the evidence does not show whether they match current Hugging Face pricing. Technically it is a SKILL.md playbook plus three PEP 723 uv scripts built on the Transformers Trainer, a dataset inspector that reads the Datasets Server API, a cost estimator and reference notebooks. The inspector and the estimator both work by rough rules of thumb. The skill is licensed Apache 2.0 at the repository root. No execution logs or test results for the bundled scripts are supplied, so how they behave on real datasets is unknown.

Researched and written by an AI model and checked by a second AI model. How it works

This report covers the complete folder skills/huggingface-vision-trainer in the huggingface/skills repository at commit 25910b3d0ba31a2ba102f901cdc9e008c278a69c. That means SKILL.md, the three training scripts, the dataset inspector, the cost estimator and the six reference documents, plus the Apache 2.0 LICENSE at the repository root as the applicable notice. No NOTICE file was captured. Excluded: other skills in the repository (including the hugging-face-jobs and hugging-face-model-trainer skills it refers to), the repository README, linked external pages, the Hugging Face Jobs service and its pricing, and the models and datasets named in the examples. How any client installs, finds or switches on the skill is not described in the captured files. No execution logs or test results for the bundled scripts are supplied, so training behaviour, the inspector's verdicts, job success, costs and result quality are unverified by the evidence.

The overview

What it is

The resource is the folder skills/huggingface-vision-trainer in the huggingface/skills repository on GitHub, captured at commit 25910b3d0ba31a2ba102f901cdc9e008c278a69c. Its SKILL.md frontmatter names it huggingface-vision-trainer and describes it as a skill that trains and fine-tunes vision models on Hugging Face Jobs cloud GPUs. It is not a model or a hosted service. It is a set of instructions and helper files meant for an AI coding assistant to use when preparing, launching and reporting on training jobs.

The folder holds SKILL.md, three training scripts (object_detection_training.py, image_classification_training.py and sam_segmentation_training.py), two helper scripts (dataset_inspector.py and estimate_cost.py) and six reference documents: an object detection notebook, an image classification notebook, a SAM2 fine-tuning walkthrough, a timm usage note, a Hub saving guide and a reliability principles note. The licence file sits at the repository root, outside the folder, and is the Apache License 2.0.

Overall assessment

Going by its contents, this is a substantial and carefully built skill rather than a stub. It goes beyond advice. It ships training scripts that look ready to run, with complete dependency headers. It also provides a first-pass dataset check to run before spending money on GPUs, explicit required flags, a timeout table, a list of common failures with fixes, and a step that asks the user to confirm dataset size, validation split and hardware before a job is submitted. It tells the assistant to report the job ID and then wait for the user, instead of checking job status repeatedly on its own.

The main weaknesses are practical rather than structural. The main Jobs workflow needs a paid Hugging Face plan. It prefers the hf_jobs MCP tool but does not require it: SKILL.md's first directive documents HfApi().run_uv_job from the huggingface_hub Python library as the alternative when that tool is unavailable. Its preference-question step names an AskUserQuestion tool, and the evidence does not show whether other clients provide an equivalent. Its prices and time estimates are fixed numbers inside the files, and current Hugging Face prices are unknown from the evidence. The dataset inspector's READY verdict is a rough check, not a guarantee. The SAM script reports only loss, not a segmentation quality metric. A few documents contradict each other in small ways (listed under limitations). The evidence includes no run results for the skill's own scripts, so how well they work on real datasets is unknown.

Who it is for

It is aimed at developers and machine learning practitioners who have a dataset on the Hugging Face Hub, or can build one, and want to fine-tune a detector, a classifier or a SAM/SAM2 model, mainly without setting up a local GPU. Beginners get a lot of help: the skill names a starting model for each task, gives default hyperparameters and explains the dataset columns it expects. A beginner still needs to understand bounding box formats, epochs, validation splits and the cost of GPU hours, because the skill leaves those decisions to the user.

It is not for text or language model fine-tuning; SKILL.md sends that work to a separate hugging-face-model-trainer skill. The captured files do not cover image generation or video training.

The skill is cloud-first. Its step-by-step workflow sends training to Hugging Face Jobs, which SKILL.md says needs a paid plan. SKILL.md also says detection and classification models can be fine-tuned 'on cloud GPUs or local'. The object detection, image classification and SAM2 reference documents contain direct Transformers Trainer training examples, with their own pip install lines, that never submit a Job. People without Jobs access can follow those on any suitable compute, local or hosted elsewhere; the object detection reference says that training needs at least one GPU and describes a run on a Google Colab T4 GPU. Running outside Jobs avoids Jobs charges, but that compute has its own cost, which the evidence does not cover.

What it can do

Object detection: it fine-tunes models that AutoModelForObjectDetection can load. SKILL.md recommends D-FINE (small, large, and xlarge pretrained on Objects365) and RT-DETR v2 (r18vd, r50vd and r101vd), and also mentions DETR and YOLOS. The script works out whether bounding boxes are xyxy or xywh by checking up to 50 images. It then converts and clips boxes, drops degenerate ones, adds a missing image_id and remaps string categories to integer IDs. It creates a validation split if none exists (15 percent by default), applies Albumentations augmentation, and evaluates with torchmetrics mAP and mAR, including per-class values.

Image classification: it fine-tunes any model that AutoModelForImageClassification can load, with timm checkpoints (MobileNetV3, MobileViT, ResNet50 and ViT/DINOv3) as the recommended set. It finds the label column automatically, remaps string labels, builds torchvision training and validation transforms from the image processor settings, and reports accuracy.

SAM and SAM2 segmentation: it fine-tunes Sam2Model or SamModel with bounding box or point prompts. Prompts come from a JSON prompt column or from dedicated bbox or point columns. By default only the mask decoder is trained; the vision and prompt encoders stay frozen. The loss is MONAI DiceCELoss, supplied through compute_loss_func because SAM models do not compute a loss in their forward() method.

Around training: a dataset inspector runs quick checks on a few sample rows (five by default) of a Hub dataset through the Datasets Server API, without downloading it. Its READY verdicts rest mainly on matching column names, so they are a first check, not proof that a training script will accept the data (see limitations). The skill also includes a cost and time estimator, Trackio logging, and pushing of the final model to the Hub with a generated model card. The reference documents explain the same tasks in notebook form.

Using it

What you need

Account and access for the Jobs workflow: SKILL.md says Hugging Face Jobs require a Pro, Team or Enterprise plan. The user's token needs write permission and must be passed to the job as a secret. The assistant needs either the hf_jobs MCP tool or the huggingface_hub Python API (HfApi().run_uv_job). The evidence does not state which huggingface_hub version first provides the Jobs API.

Tooling: the helper scripts run with uv and declare Python 3.10 or newer. The training scripts carry PEP 723 dependency blocks that uv installs inside the job. All three need transformers 5.2.0 or newer, accelerate 1.1.0 or newer, trackio and huggingface_hub; the detection and classification scripts also need datasets 4.0 or newer. On top of that, detection needs albumentations, torchmetrics and pycocotools, classification needs timm, evaluate and scikit-learn, and SAM needs MONAI. The scripts also run a Transformers minimum-version check for 4.57.0.dev0, which the declared 5.2.0 minimum satisfies.

Data: the dataset must be on the Hub. Detection data needs an objects column with bbox and category fields. Classification needs an image column and a label column. SAM needs an image column, a binary mask column, and a prompt given as JSON, a bbox column or a point column, with boxes in absolute xyxy pixel coordinates.

Assistant: SKILL.md tells the assistant to use an AskUserQuestion tool for its preference questions. That name looks specific to certain assistants, and the evidence does not show whether other clients provide an equivalent.

How it works

SKILL.md's description field lists the uses it is meant for, along with terms such as object detection, SAM2, D-FINE and fine-tuning vision models on Hugging Face Jobs. These files do not say how a given assistant client installs, finds or switches on the skill, so that is unknown. When the skill is in use, SKILL.md lays out a five-step workflow. First, verify prerequisites. Second, validate the dataset with dataset_inspector.py. Third, ask the user about a quick test versus a full run, the validation split and the GPU flavor. Fourth, pick the matching training script. Fifth, save a copy of the script under submitted_jobs/ and submit it as a uv job. The assistant is told to report the job ID, the monitoring URL, the Trackio dashboard, the expected time and the estimated cost, and then wait for the user to ask for status.

Each training script uses HfArgumentParser over three dataclasses (model arguments, data arguments and standard TrainingArguments). Configuration is supplied without editing code, in one of two ways. The first is command-line arguments, which are passed in script_args when a job is submitted. The second applies when the script receives a single argument ending in .json: it then reads its configuration from that JSON file through parse_json_file. SKILL.md documents only the command-line route. Each script logs in with HF_TOKEN from the environment, copies the token into training_args.hub_token before the Trainer is built, and starts Trackio. It then loads the dataset, builds the Trainer, trains and evaluates when the do_train and do_eval flags ask for it, saves, and pushes to the Hub if push_to_hub is set.

The inspector calls the public Datasets Server splits and rows endpoints with urllib and reads a few sample rows (five by default). It then runs quick checks for each of the three tasks, based mainly on column-name patterns plus a look at sample values. A READY verdict does not guarantee that a training script will accept the dataset (see limitations). The inspector sends no authentication header, so private or gated datasets appear not to be inspectable this way. The cost estimator works out a per-step time from model size, image size and batch size, multiplies it by the number of steps and a per-GPU factor, and adds evaluation and fixed overheads. Its constants are described only as empirical calibration values.

Setup

The captured files do not explain how to install the skill folder in a particular assistant, or how a client finds and switches on the skill. Installation and activation in any given client are therefore unknown from this evidence; check your client's documentation.

Once the skill is available, the evidence describes this preparation. Confirm you are logged in (hf_whoami() or hf auth whoami) with a write token, and make sure your plan includes Jobs. Verify that the dataset exists and run dataset_inspector.py on it, either through an HF Job, locally with uv run, or through HfApi().run_uv_job. Decide on a hub_model_id in the form username/model-name. SKILL.md also says to pass the token in job secrets: the string $HF_TOKEN for the hf_jobs tool, or get_token() for the Python API. The two methods also differ in the script parameter (a code string or URL for the tool, a file path for the API) and in timeout format (a string such as 4h, or a number of seconds). SKILL.md has a table for this.

Worked example from the skill

SKILL.md's object detection quick start uses the cppe-5 dataset, which is also the script's default. The script arguments are: model_name_or_path ustc-community/dfine-small-coco, dataset_name cppe-5, image_square_size 640, output_dir dfine_finetuned, num_train_epochs 30, per_device_train_batch_size 8, learning_rate 5e-5, evaluation and saving every epoch, save_total_limit 2, load_best_model_at_end, metric_for_best_model eval_map, greater_is_better True, no_remove_unused_columns, no_eval_do_concat_batches, push_to_hub, a hub_model_id, do_train and do_eval. It is submitted with HfApi().run_uv_job on flavor t4-small, with a timeout of 14400 seconds and the token in secrets.

Two kinds of flag are easy to get wrong. Optional[bool] arguments such as greater_is_better need an explicit True, while plain boolean fields use bare flags or a no_ prefix. Similar quick starts exist for classification (timm/mobilenetv3_small_100.lamb_in1k on ethz/food101, 5 epochs, timeout 7200 seconds) and for SAM2 (facebook/sam2.1-hiera-small on merve/MicroMat-mini with bbox prompts, 30 epochs, learning rate 1e-5).

For a sense of what results look like, the object detection reference notebook records a Conditional DETR run on CPPE-5. It reached validation mAP 0.277 at epoch 30 and test mAP 0.4116 on the dataset's 29-image test split. That result comes from the upstream tutorial, not from D-FINE or these scripts, and the evidence includes no independent reproduction of it. The evidence contains no reported results for the classification or SAM scripts.

Assessment & evidence

Limitations and risks

No run evidence: the evidence includes no execution logs or test results for the scripts or instructions. It is therefore unknown whether they work, whether the automatic detection steps are correct, and whether the current Transformers release accepts the flags. The scripts require transformers 5.2.0 or newer with no upper bound, so later releases could change behaviour.

Dataset inspector: dataset_inspector.py gives only a first check, not a guarantee that training will accept a dataset. It looks at five sample rows by default and can report READY from column names alone. For detection, it only needs an image-like column plus a column whose name matches a pattern such as objects, annotations, ann or bbox; it does not check that the bbox and category contents are valid. For SAM, it needs image, mask and prompt columns but ignores the result of its own bbox validation. That check can label a box as likely xywh and still call it valid, even though the SAM script expects xyxy.

The inspector also accepts alternative column names that the object detection trainer does not, such as img, picture or photo for images, and annotations or detection for annotations. The trainer reads fixed image and objects columns. For SAM, the inspector's printed hint names only --prompt_type and, when there is a prompt column, --prompt_column_name. It leaves out the image, mask, bbox and point column flags that the SAM script needs when those columns have other names or when prompts sit in dedicated columns. Before training, confirm the actual schema, the bounding box coordinate convention (xywh or xyxy, in absolute pixels) and the column names each script requires.

Evaluation: in all three scripts, training runs only if you pass do_train and evaluation runs only if you pass do_eval. The documented detection and classification quick starts set load_best_model_at_end with metric_for_best_model (eval_map or eval_accuracy), which picks the best checkpoint on the validation split. When do_eval is set and the dataset has no test split, the scripts' final evaluation then runs on that same validation split, so the final figure is not an independent test. The SAM quick start passes do_train without do_eval, so it does not ask for validation evaluation. When evaluation is requested, the SAM script computes only the DiceCE loss, with no IoU or similar quality metric.

Other training details: the SAM script resizes ground-truth masks to 256 by 256 pixels with nearest-neighbour sampling for the loss, which may lose fine detail for matting. The classification script builds its own torchvision transforms. When the image processor does not expose size or mean values, it falls back to 224 pixels and the ImageNet mean and standard deviation. The evidence does not establish whether that matches each timm model's own data configuration, and the script does not use the timm training transforms that timm_trainer.md mentions.

Documentation inconsistencies: SKILL.md refers to directive numbers that do not line up; for example, it calls the timeout section directive 6, but that section is numbered 5. Its Reading Results section names a 'NEEDS FORMATTING' status, but the inspector prints 'NOT COMPATIBLE'. SKILL.md says not to call login() in custom scripts unless you copy the template pattern, and its snippet shows only the hub_token injection, yet the templates and the Hub saving guide also call login(). The complete examples in hub_saving.md pass a raw dataset to a collator that expects pixel_values, so they look illustrative rather than runnable as written. reliability_principles.md includes examples unrelated to vision training. One is a DPO dataset name (trl-lib/argilla-dpo-mix-7k, corrected to trl-lib/ultrafeedback_binarized). Others are calls to tools named dataset_search and hub_repo_details, and the evidence does not show whether those tools are available. The same file claims that following its principles lifts job success from about 60 to 70 percent to about 95 percent, and the evidence contains no data to support that.

Safety and privacy: the Jobs workflow passes a Hub token with write access into a remote job and pushes models to a repository. The quick-start arguments do not set repository visibility, so check whether the created repository is public or private for your account. The training scripts keep trust_remote_code off by default, and SKILL.md tells the assistant to ask the user about dataset size, validation split and hardware before submitting a job.

Why this assessment

The assessment rests mostly on how well the pieces agree with each other. The SKILL.md instructions, the script argument names (for example image_square_size, prompt_type, train_val_split and max_train_samples) and the required flags match the argument dataclasses in the three scripts. The failure modes SKILL.md lists, such as single-class mAP tensors and missing test splits, have matching code paths in the object detection script. That agreement suggests the skill was assembled from real use, although it does not prove the scripts run on current library versions.

The dataset inspector is the weaker link. Its READY verdicts are only a first check. It accepts column names that the detection trainer does not read, and its printed hints do not always include the column flags the trainers need. Users therefore have to confirm the actual schema, the coordinate convention and the required column names themselves instead of relying on its output.

Other reservations come from things the files cannot show: real-world run results for the bundled scripts, current prices, and how each assistant client installs and activates the skill and handles its tool names. The judgement is that the skill is credible and useful for its stated tasks, but its numbers are unverified and its dataset check is only preliminary.

Alternatives

Inside the same repository, SKILL.md points to a hugging-face-jobs skill for general Jobs questions (secrets, hardware, timeouts) and a hugging-face-model-trainer skill for TRL-based language model training. Neither was part of the captured material, so their contents and quality are not assessed here.

The captured files support two other routes besides the full assistant-driven Jobs workflow. The first is to use the bundled Trainer scripts yourself; they take configuration as command-line arguments or as a single JSON configuration file. Submitting them through Jobs is the documented route, and the files give no step-by-step procedure for running these training scripts locally. The second is to follow the included reference examples for object detection, image classification and SAM2, which train directly with the Transformers Trainer and never submit a Job.

The skill is cloud-first: its main workflow is built around Hugging Face Jobs and Hub saving, while the reference examples show a path that does not need Jobs. The evidence does not discuss other external training tools, so how they are implemented and how they compare with this skill remain unknown.

Evidence base

The evidence is thirteen captured files at one commit. They are SKILL.md, the three training scripts, the dataset inspector, the cost estimator, six reference documents (SAM2 fine-tuning, Hub saving, image classification notebook, object detection notebook, reliability principles and timm trainer) and the repository LICENSE. The strongest evidence is the code, which shows exactly what each script does and requires. The weaker evidence is the prices, time estimates and success-rate claims, which come without sources, and current Hugging Face prices are not included.

No execution logs or test results for the bundled training scripts are supplied. The object detection reference includes upstream reported training and test metrics, but those come from a tutorial run with a different model, and no independent reproduction is supplied. Also missing are issue history, release notes and a README with installation steps.

Access & freshness

Costs

The skill itself is free to use under Apache 2.0. Its main workflow spends money on Hugging Face Jobs: SKILL.md says the Jobs feature needs a Pro, Team or Enterprise plan, and the skill's own figures price compute per hour by GPU flavor. The evidence does not state the subscription price, so it is unknown here. Running the reference documents' direct Trainer examples outside Jobs carries no Jobs charges, but it needs access to suitable compute, which may be local or hosted elsewhere. The object detection reference says training needs at least one GPU and describes a run on a Google Colab T4 GPU. The cost of that compute is unknown from the evidence.

The hourly prices hard-coded in estimate_cost.py are: t4-small 0.40 dollars, t4-medium 0.60, l4x1 0.80, l4x4 3.80, a10g-small 1.00, a10g-large 1.50, a10g-largex2 3.00, a10g-largex4 5.00, l40sx1 1.80, l40sx4 8.30, a100-large 2.50 and a100x4 10.00. SKILL.md quotes four of these in its hardware question. These are the skill's own numbers at the captured commit. Current Hugging Face pricing is unknown from the evidence, so these figures may be out of date.

Total job cost is unknown for any real dataset. The estimator relies on calibration constants that are not explained, and it makes no claim about accuracy. In SKILL.md's example question, a quick test is described as '~30-60 min, ~$2-5'. That does not match the 0.40 dollars per hour t4-small rate, where an hour would cost well under 1 dollar, so treat these figures as illustrative. The object detection reference gives about 35 minutes in one place and about 26 minutes in another for 30 epochs of CPPE-5 on a T4. The evidence does not say whether or how a timed-out or failed job is billed.

Rights and licence

The repository's LICENSE file, captured at the same commit, is the Apache License, Version 2.0. Its copyright grant (section 2) is perpetual, worldwide, non-exclusive, no-charge, royalty-free and irrevocable. It covers reproducing the work, preparing derivative works, publicly displaying and performing it, sublicensing it and distributing it, in source or object form. The patent grant (section 3) is separate and narrower. It covers making, having made, using, offering to sell, selling, importing and otherwise transferring the work. Each contributor licenses only those of its patent claims that its own contribution necessarily infringes, alone or combined with the work. If you start patent litigation claiming that the work, or a contribution in it, infringes a patent, the patent licences you received for that work end on the date the litigation is filed.

Redistribution (section 4) has conditions. You must give recipients a copy of the licence and mark modified files with prominent notices. Section 4(c) requires you to keep the copyright, patent, trademark and attribution notices from the Source form of the work in the Source form of any derivative works you distribute. Notices that do not pertain to any part of the derivative works are excluded. This condition is written for the Source form; it does not cover every form you distribute, such as object form. Section 4(d) applies only if the work includes a NOTICE file. In that case, distributed derivative works must include a readable copy of its attribution notices, again leaving out notices that do not pertain to any part of the derivative works. That copy must appear in at least one of three places: a NOTICE file distributed with the derivative works, their source form or documentation, or a display they generate where such third-party notices normally appear. No NOTICE file was captured here. The licence grants no trademark rights beyond reasonable and customary use in describing the origin of the work and reproducing the NOTICE content, and the work is provided as is, without warranty.

The appendix template line 'Copyright [yyyy] [name of copyright owner]' in the captured LICENSE is unfilled, so the file itself does not name a copyright holder. The individual files in the skill folder carry no separate licence headers in the captured text. Some reference documents contain links in Transformers documentation path formats, for example /docs/transformers/v5.2.0/en/... The evidence does not establish whether any of that text comes from another source with its own attribution requirements.

Models you train are a separate matter. The base models (D-FINE, RT-DETR v2, SAM2, DINOv3, timm checkpoints and others) and the example datasets (cppe-5, food101 and MicroMat-mini) have their own licences, which the evidence does not cover. Check them before publishing or selling a fine-tuned model.

Freshness

The content was captured on 2026-11-15 at commit 25910b3d0ba31a2ba102f901cdc9e008c278a69c. The evidence gives no commit date, release tag or change history, so when the skill was written and how often it is maintained are unknown. The files set Transformers 5.2.0 as a minimum dependency and link to Transformers documentation versions 5.1.0 and 5.2.0. That shows which versions the content refers to, not when it was written or last updated.

Several parts will age: model names and parameter counts in the recommendation tables, the hard-coded GPU price list, the hardware flavor names, the Hugging Face Jobs API and the Trackio integration. Check them against current Hugging Face documentation before relying on them.

What to do next

If you plan to use the Jobs workflow, confirm that your plan includes Hugging Face Jobs and create a token with write permission. Read the training script you intend to submit, because it will run remotely with that token. Run the dataset inspector on any dataset you have not trained on before. Then confirm the column names, the bounding box convention and the schema yourself, because its READY verdict is only a first check. Start with a small run (the scripts accept max_train_samples and max_eval_samples) on the cheapest GPU the skill recommends. If you have access to suitable compute outside Jobs, local or hosted elsewhere, the reference examples offer a direct Trainer path without Jobs; the cost of that compute is not covered by the evidence.

Set a timeout well above the expected run time; SKILL.md suggests at least 2 to 4 hours for detection and gives a table. Choose a hub_model_id you control and check the visibility of the repository that gets created. Pass do_eval if you want an evaluation, treat the estimator's dollar figures as rough, and compare the prices with the current Hugging Face pricing page. Hold out your own test set if you need an unbiased score. If your assistant has no AskUserQuestion tool, expect to adapt that step. Review the base model and dataset licences before sharing the result.

Evidence for this report

LICENSEnotice · checked 2026-11-15
skills/huggingface-vision-trainer/SKILL.mdselected · checked 2026-11-15