Skillpedia
تعلّم الآلة11k · #11779

huggingface-vision-trainer

ما الذي تفعله

تدرّب هذه المهارة نماذج الصور على صورك المُعلَّمة، مثل كاشفات تجد الأشياء أو مصنّفات ترتب الصور. وهي لمن يحتاج إلى نموذج رؤية مخصص.

متى تستخدمها

  • ✓عندما تريد ضبط نموذج كشف أشياء دقيقاً على صورك.
  • ✓عندما تريد تدريب مصنّف صور على مجموعة بيانات مخصصة.
  • ✓عندما تريد نموذج تجزئة مدرّباً بالأقنعة أو بالتلميحات.

رابط المهارة

https://github.com/huggingface/skills/blob/main/skills/huggingface-vision-trainer/SKILL.md

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/huggingface/skills/blob/main/skills/huggingface-vision-trainer/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“اضبط كاشف أشياء دقيقاً على مجلد صور المنتجات المُعلَّمة لدي، واحفظ النموذج في Hub.”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

يجهّز الذكاء الاصطناعي مجموعة البيانات بصيغة COCO القياسية، ويضبط التعزيز والتقييم، ثم يشغّل التدريب على وحدات معالجة رسوميات سحابية في Hugging Face Jobs. ويُحفظ النموذج المدرّب في Hub تلقائياً.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من 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.

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:

uv run scripts/dataset_inspector.py --dataset username/dataset-name --split train
uv run scripts/estimate_cost.py --help

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) 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
  • image_id 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 column can be ClassLabel type (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 image column (PIL images) and a mask column (binary ground-truth segmentation mask)
  • Must have a prompt — either:
    • A prompt column with JSON containing {"bbox": [x0,y0,x1,y1]} or {"point": [x,y]}
    • OR a dedicated bbox column with [x0,y0,x1,y1] values
    • OR a dedicated point column with [x,y] or [[x,y],...] values
  • 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 in secrets

Dataset Validation

Validate dataset format BEFORE launching GPU training to prevent the #1 cause of training failures: format mismatches.

ALWAYS validate for unknown/custom datasets or any dataset you haven't trained with before. Skip for cppe-5 (the default in the training script).

Running the Inspector

Option 1: Via HF Jobs (recommended — avoids local SSL/dependency issues): `

الأسئلة الشائعة

أي صيغة بيانات يحتاج إليها؟

يستخدم صيغة COCO لمجموعات بيانات الكشف عن الأشياء، ويساعدك في تجهيز بياناتك.

هل يقيّم النموذج؟

نعم. يعرض الدقة ومقاييس الكشف مثل mAP وmAR.

هل أحتاج إلى وحدة معالجة رسوميات محلية؟

لا. الافتراضي وحدات معالجة سحابية مُدارة، رغم إمكانية التدريب المحلي أيضاً.

التفاصيل

الوصف الأصلي من المؤلف

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 class

repo: huggingface/skills

الشعبية

نجوم GitHub
11k
الترتيب
#11779
الترخيص
Apache-2.0
آخر تحديث
30‏/10‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة