Link to this sectionمجموعة بيانات COCO12-Formats#
Link to this sectionمقدمة#
مجموعة بيانات COCO12-Formats من Ultralytics هي مجموعة بيانات اختبار متخصصة مصممة للتحقق من تحميل الصور عبر 12 امتداداً مدعوماً لتنسيقات الصور. تحتوي على 12 صورة (6 للتدريب، 6 للتحقق)، حيث تم حفظ كل منها بتنسيق مختلف لضمان اختبار شامل لخط تحميل الصور.
تعتبر مجموعة البيانات هذه ذات قيمة كبيرة في الحالات التالية:
- اختبار دعم تنسيق الصور: التحقق من أن تنسيقات الصور الشائعة يتم تحميلها بشكل صحيح
- خطوط CI/CD: الاختبار الآلي لتوافق التنسيقات
- تصحيح الأخطاء: عزل المشكلات الخاصة بتنسيق معين في خطوط تدريب النماذج
- التطوير: التحقق من صحة الإضافات أو التغييرات الجديدة في التنسيقات
Link to this sectionالتنسيقات المدعومة#
تتضمن مجموعة البيانات صورة واحدة لكل تنسيق من التنسيقات الـ 12 المدعومة والمحددة في ملف ultralytics/data/utils.py:
| التنسيق | الامتداد | الوصف | تدريب/تحقق |
|---|---|---|---|
| AVIF | .avif | تنسيق ملف صورة AV1 (حديث) | التدريب |
| BMP | .bmp | Bitmap - تنسيق نقطي غير مضغوط | التدريب |
| DNG | .dng | Digital Negative - تنسيق RAW من Adobe | التدريب |
| HEIC | .heic | ترميز الصور عالي الكفاءة | التدريب |
| JPEG | .jpeg | JPEG مع امتداد كامل | التدريب |
| JPG | .jpg | JPEG مع امتداد قصير | التدريب |
| JP2 | .jp2 | JPEG 2000 - طبي/جغرافي مكاني | التحقق |
| MPO | .mpo | كائن متعدد الصور (صور مجسمة) | التحقق |
| PNG | .png | رسومات الشبكة المحمولة | التحقق |
| TIF | .tif | TIFF مع امتداد قصير | التحقق |
| TIFF | .tiff | تنسيق ملف الصور المرمز | التحقق |
| WebP | .webp | تنسيق صور ويب حديث | التحقق |
Link to this sectionهيكل مجموعة البيانات#
coco12-formats/
├── images/
│ ├── train/ # 6 images (avif, bmp, dng, heic, jpeg, jpg)
│ └── val/ # 6 images (jp2, mpo, png, tif, tiff, webp)
├── labels/
│ ├── train/ # Corresponding YOLO format labels
│ └── val/
└── coco12-formats.yaml # Dataset configurationLink to this sectionYAML مجموعة البيانات#
تم تكوين مجموعة بيانات COCO12-Formats باستخدام ملف YAML يحدد مسارات مجموعة البيانات وأسماء الفئات. يمكنك مراجعة ملف coco12-formats.yaml الرسمي في مستودع Ultralytics على GitHub.
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
# COCO12-Formats dataset (12 images testing all supported image formats) by Ultralytics
# Documentation: https://docs.ultralytics.com/datasets/detect/coco12-formats/
# Example usage: yolo train data=coco12-formats.yaml
# parent
# ├── ultralytics
# └── datasets
# └── coco12-formats ← downloads here (1 MB)
# Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]
path: coco12-formats # dataset root dir
train: images/train # train images (relative to 'path') 6 images
val: images/val # val images (relative to 'path') 6 images
test: # test images (optional)
# Classes
names:
0: person
1: bicycle
2: car
3: motorcycle
4: airplane
5: bus
6: train
7: truck
8: boat
9: traffic light
10: fire hydrant
11: stop sign
12: parking meter
13: bench
14: bird
15: cat
16: dog
17: horse
18: sheep
19: cow
20: elephant
21: bear
22: zebra
23: giraffe
24: backpack
25: umbrella
26: handbag
27: tie
28: suitcase
29: frisbee
30: skis
31: snowboard
32: sports ball
33: kite
34: baseball bat
35: baseball glove
36: skateboard
37: surfboard
38: tennis racket
39: bottle
40: wine glass
41: cup
42: fork
43: knife
44: spoon
45: bowl
46: banana
47: apple
48: sandwich
49: orange
50: broccoli
51: carrot
52: hot dog
53: pizza
54: donut
55: cake
56: chair
57: couch
58: potted plant
59: bed
60: dining table
61: toilet
62: tv
63: laptop
64: mouse
65: remote
66: keyboard
67: cell phone
68: microwave
69: oven
70: toaster
71: sink
72: refrigerator
73: book
74: clock
75: vase
76: scissors
77: teddy bear
78: hair drier
79: toothbrush
# Download script/URL (optional)
download: https://github.com/ultralytics/assets/releases/download/v0.0.0/coco12-formats.zipLink to this sectionالمتطلبات#
تتطلب بعض التنسيقات تبعيات إضافية:
pip install pillow pillow-heif pillow-avif-pluginLink to this sectionمكتبة نظام AVIF (اختياري)#
لكي يتمكن OpenCV من قراءة ملفات AVIF مباشرة، يجب تثبيت libavif قبل بناء OpenCV:
brew install libavifقد لا تتضمن حزمة opencv-python المثبتة عبر pip دعم AVIF لأنها مبنية مسبقاً. تستخدم Ultralytics مكتبة Pillow مع pillow-avif-plugin كخيار احتياطي لصور AVIF عندما يفتقر OpenCV إلى الدعم.
Link to this sectionالاستخدام#
لتدريب نموذج YOLO على مجموعة بيانات COCO12-Formats، استخدم الأمثلة التالية:
from ultralytics import YOLO
# Load a pretrained YOLO model
model = YOLO("yolo26n.pt")
# Train on COCO12-Formats to test 12 supported image formats
results = model.train(data="coco12-formats.yaml", epochs=1, imgsz=640)Link to this sectionملاحظات خاصة بالتنسيقات#
Link to this sectionAVIF (تنسيق ملف صورة AV1)#
AVIF هو تنسيق صور حديث يعتمد على برنامج ترميز الفيديو AV1، ويوفر ضغطاً ممتازاً. يتطلب pillow-avif-plugin:
pip install pillow-avif-pluginLink to this sectionDNG (Digital Negative)#
DNG هو تنسيق RAW مفتوح من Adobe يعتمد على TIFF. لأغراض الاختبار، تستخدم مجموعة البيانات ملفات تعتمد على TIFF مع امتداد .dng.
Link to this sectionJP2 (JPEG 2000)#
JPEG 2000 هو معيار ضغط صور يعتمد على المويجات، ويوفر ضغطاً وجودة أفضل من JPEG التقليدي. يستخدم عادة في التصوير الطبي (DICOM)، والتطبيقات الجغرافية المكانية، والسينما الرقمية. مدعوم أصلاً بواسطة كل من OpenCV و Pillow.
Link to this sectionMPO (كائن متعدد الصور)#
تُستخدم ملفات MPO للصور المجسمة (ثلاثية الأبعاد). تخزن مجموعة البيانات بيانات JPEG قياسية مع امتداد .mpo لاختبار التنسيق.
Link to this sectionHEIC (ترميز الصور عالي الكفاءة)#
يتطلب HEIC حزمة pillow-heif للترميز الصحيح:
pip install pillow-heifLink to this sectionحالات الاستخدام#
Link to this sectionاختبار CI/CD#
from ultralytics import YOLO
def test_image_formats():
"""Test that 12 supported image formats load correctly."""
model = YOLO("yolo26n.pt")
results = model.train(data="coco12-formats.yaml", epochs=1, imgsz=64)
assert results is not NoneLink to this sectionالتحقق من التنسيقات#
from pathlib import Path
from ultralytics.data.utils import IMG_FORMATS
# Verify all dataset formats are supported
dataset_dir = Path("datasets/coco12-formats/images")
found_formats = {f.suffix[1:].lower() for f in dataset_dir.rglob("*.*")}
assert found_formats <= IMG_FORMATS, f"Unsupported formats: {found_formats - IMG_FORMATS}"Link to this sectionالاقتباسات والشكر#
إذا كنت تستخدم مجموعة بيانات COCO في بحثك، فيرجى الاستشهاد بها:
@misc{lin2015microsoft,
title={Microsoft COCO: Common Objects in Context},
author={Tsung-Yi Lin and Michael Maire and Serge Belongie and Lubomir Bourdev and Ross Girshick and James Hays and Pietro Perona and Deva Ramanan and C. Lawrence Zitnick and Piotr Doll{\'a}r},
year={2015},
eprint={1405.0312},
archivePrefix={arXiv},
primaryClass={cs.CV}
}Link to this sectionالأسئلة الشائعة#
Link to this sectionما هي استخدامات مجموعة بيانات COCO12-Formats؟#
تم تصميم مجموعة بيانات COCO12-Formats لاختبار توافق تنسيق الصور في خطوط تدريب YOLO من Ultralytics. وهي تضمن أن التنسيقات الـ 12 المدعومة للصور (AVIF، BMP، DNG، HEIC، JP2، JPEG، JPG، MPO، PNG، TIF، TIFF، WebP) يتم تحميلها ومعالجتها بشكل صحيح.
Link to this sectionلماذا يتم اختبار تنسيقات صور متعددة؟#
تتميز تنسيقات الصور المختلفة بخصائص فريدة (الضغط، عمق البت، مساحات الألوان). يضمن اختبار جميع التنسيقات ما يلي:
- كود تحميل صور قوي
- التوافق عبر مجموعات بيانات متنوعة
- الكشف المبكر عن الأخطاء الخاصة بالتنسيقات
Link to this sectionأي التنسيقات تتطلب تبعيات خاصة؟#
- AVIF: يتطلب
pillow-avif-plugin - HEIC: يتطلب
pillow-heif