مجموعة بيانات COCO-Seg
توفر مجموعة بيانات COCO-Seg أقنعة تجزئة الكائنات في COCO (الكائنات الشائعة في سياقها) — 118,287 صورة تدريب و5,000 صورة تحقق، مع أقنعة مضلعات تغطي 80 فئة من الكائنات — بتنسيق تسميات Ultralytics YOLO. تستخدم المجموعة صور COCO الأصلية وشروح التجزئة الأصلية، بعد تحويلها لتدريب YOLO، ما يجعلها موردًا قياسيًا للباحثين والمطورين العاملين على مهام تجزئة الكائنات.
نماذج COCO-Seg المدرّبة مسبقًا#
| النموذج | الحجم (بكسل) | mAPالصندوق50-95 (e2e) | mAPالقناع50-95 (e2e) | السرعة CPU ONNX (مللي ثانية) | السرعة T4 TensorRT10 (ms) | المعاملات (M) | FLOPs (B) |
|---|---|---|---|---|---|---|---|
| YOLO26n-seg | 640 | 39.6 | 33.9 | 53.3 ± 0.5 | 2.1 ± 0.0 | 2.7 | 9.3 |
| YOLO26s-seg | 640 | 47.3 | 40.0 | 118.4 ± 0.9 | 3.3 ± 0.0 | 10.4 | 34.5 |
| YOLO26m-seg | 640 | 52.5 | 44.1 | 328.2 ± 2.4 | 6.7 ± 0.1 | 23.6 | 121.7 |
| YOLO26l-seg | 640 | 54.4 | 45.5 | 387.0 ± 3.7 | 8.0 ± 0.1 | 28.0 | 140.1 |
| YOLO26x-seg | 640 | 56.5 | 47.0 | 787.0 ± 6.8 | 16.4 ± 0.1 | 62.8 | 314.0 |
الميزات الرئيسية#
- توفر COCO-Seg أقنعة تجزئة الكائنات الفردية لـ 123,287 صورة موسومة من مجموعتي COCO train2017/val2017 (118,287 للتدريب + 5,000 للتحقق)، من إجمالي الإصدار الأوسع من COCO الذي يضم ~330 ألف صورة.
- تتكون مجموعة البيانات من فئات الكائنات الثمانين نفسها الموجودة في مجموعة بيانات COCO الأصلية.
- توفر التعليقات التوضيحية أقنعة تجزئة الكائنات الفردية بتنسيق تسميات مضلعات YOLO.
- توفر COCO-Seg مقاييس mAP وmAR موحدة لتقييم أداء تجزئة الكائنات الفردية، ما يتيح مقارنة أداء النماذج بفاعلية.
- حجم التنزيل: ~20.3 غيغابايت عند الاستخدام الأول (
train2017.zip+val2017.zip+ التسميات). لا يُنزّلtest2017.zip، حجمه 7 غيغابايت، تلقائيًا، لأن الصور فيه تحجب تسمياتها المرجعية ولا يلزم إلا لإرسال مساهمة test-dev2017.
بنية مجموعة البيانات#
تُقسَّم مجموعة بيانات COCO-Seg إلى ثلاث مجموعات فرعية:
- Train2017: 118,287 صورة لتدريب نماذج تجزئة الكائنات.
- Val2017: 5,000 صورة تُستخدم للتحقق أثناء تطوير النموذج.
- Test-dev2017: 20,288 صورة من صور test2017 البالغ عددها 40,670، وتُستخدم لإجراء المقارنة المعيارية. التعليقات التوضيحية للحقيقة الأرضية لهذه المجموعة الفرعية غير متاحة للعامة، لذا يجب إرسال التنبؤات إلى خادم تقييم COCO لتقييمها.
لإجراء تجارب أصغر نطاقًا، راجع المجموعتين الفرعيتين COCO128-Seg (128 صورة) وCOCO8-Seg (8 صور).
التطبيقات#
تُستخدم COCO-Seg على نطاق واسع لتدريب نماذج التعلم العميق وتقييمها في تجزئة الكائنات، مثل نماذج YOLO. ويجعل العدد الكبير من الصور المشروحة، وتنوع فئات الكائنات، ومقاييس التقييم المعيارية منها موردًا أساسيًا للباحثين والممارسين في الرؤية الحاسوبية. كما يمكن استعراض شروح COCO-Seg الكاملة وإدارتها على منصة Ultralytics.
ملف YAML لمجموعة البيانات#
يُستخدم ملف YAML لتعريف إعدادات مجموعة البيانات. ويتضمن معلومات عن مسارات مجموعة البيانات وفئاتها وغيرها من المعلومات ذات الصلة. وفي حالة مجموعة بيانات COCO-Seg، يُصان الملف coco.yaml في https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/coco.yaml.
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
# COCO 2017 dataset https://cocodataset.org by Microsoft
# Documentation: https://docs.ultralytics.com/datasets/detect/coco
# Example usage: yolo train data=coco.yaml
# parent
# ├── ultralytics
# └── datasets
# └── coco ← downloads here (20.3 GB)
# 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: coco # dataset root dir
train: train2017.txt # train images (relative to 'path') 118287 images
val: val2017.txt # val images (relative to 'path') 5000 images
test: test-dev2017.txt # 20288 of 40670 images, submit via https://cocodataset.org/#detection-eval
# 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: |
from pathlib import Path
from ultralytics.utils import ASSETS_URL
from ultralytics.utils.downloads import download
# Download labels
segments = True # segment or box labels
dir = Path(yaml["path"]) # dataset root dir
urls = [ASSETS_URL + ("/coco2017labels-segments.zip" if segments else "/coco2017labels.zip")] # labels
download(urls, dir=dir.parent)
# Download data (test2017.zip excluded: ground truth is withheld, only used for the eval-server test-dev split)
urls = [
"http://images.cocodataset.org/zips/train2017.zip", # 19G, 118k images
"http://images.cocodataset.org/zips/val2017.zip", # 1G, 5k images
]
download(urls, dir=dir / "images", threads=3)الاستخدام#
لتدريب نموذج YOLO26n-seg على مجموعة بيانات COCO-Seg لمدة 100 حقبة وبحجم صورة 640، يمكنك استخدام مقتطفات الشيفرة التالية.
from ultralytics import YOLO
# تحميل نموذج
model = YOLO("yolo26n-seg.pt") # تحميل نموذج مدرّب مسبقًا (موصى به للتدريب)
# تدريب النموذج
results = model.train(data="coco.yaml", epochs=100, imgsz=640)صور وتعليقات توضيحية نموذجية#
تتضمن COCO-Seg الصور المتنوعة وفئات الكائنات والمشاهد المعقدة نفسها الموجودة في COCO، مع توفير أقنعة تجزئة الكائنات بتنسيق تسميات YOLO. فيما يلي بعض الأمثلة على صور من مجموعة البيانات، إلى جانب أقنعة تجزئة الكائنات المقابلة لها:

- الصورة المُركّبة بالفسيفساء: توضح هذه الصورة دفعة تدريب مكوّنة من صور مجموعة البيانات المركّبة بالفسيفساء. يُستخدم التركيب بالفسيفساء أثناء التدريب لدمج عدة صور في صورة واحدة، مما يزيد تنوع الكائنات والمشاهد في كل دفعة تدريب. ويساعد ذلك النموذج على التعميم على أحجام الكائنات ونسب الأبعاد والسياقات المختلفة.
الاستشهادات والشكر والتقدير#
إذا استخدمت مجموعة بيانات COCO-Seg في أبحاثك أو أعمالك التطويرية، فيُرجى الاستشهاد بورقة COCO الأصلية والإشارة إلى امتداد COCO-Seg:
@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ár},
year={2015},
eprint={1405.0312},
archivePrefix={arXiv},
primaryClass={cs.CV}
}نتقدم بالشكر إلى اتحاد COCO لإنشاء هذا المورد القيّم لمجتمع الرؤية الحاسوبية وصيانته.
الأسئلة الشائعة#
COCO-Seg هي حزمة بتنسيق Ultralytics YOLO لأقنعة تجزئة الكائنات الأصلية في COCO (الكائنات الشائعة في سياقها) للصور نفسها: 118,287 صورة من train2017 و5,000 صورة من val2017. تتضمن شروح COCO الأصلية هذه الأقنعة متعددة الأضلاع مسبقًا لجميع فئات الكائنات البالغ عددها 80؛ وتحولها COCO-Seg إلى تنسيق تسميات YOLO المستخدم في تدريب تجزئة الكائنات.
لتدريب نموذج YOLO26n-seg على مجموعة بيانات COCO-Seg لمدة 100 حقبة وبحجم صورة 640، يمكنك استخدام مقتطفات التعليمات البرمجية التالية. للاطلاع على قائمة مفصلة بوسائط التدريب المتاحة، راجع صفحة التدريب الخاصة بالنموذج.
مثال على التدريبfrom ultralytics import YOLO # تحميل نموذج model = YOLO("yolo26n-seg.pt") # تحميل نموذج مدرّب مسبقًا (موصى به للتدريب) # تدريب النموذج results = model.train(data="coco.yaml", epochs=100, imgsz=640)تتضمن مجموعة بيانات COCO-Seg عدة ميزات أساسية:
- توفر أقنعة تجزئة الكائنات لـ 123,287 صورة معنونة من مجموعتي COCO train2017/val2017 (118,287 للتدريب + 5,000 للتحقق).
- تُعنون فئات الكائنات الثمانين نفسها الموجودة في COCO الأصلية.
- توفر أقنعة تجزئة الكائنات بتنسيق تسميات YOLO متعدد الأضلاع.
- تستخدم مقاييس تقييم معيارية مثل متوسط الدقة المتوسط (mAP) ومتوسط الاستدعاء المتوسط (mAR) لمهام تجزئة الكائنات.
تدعم مجموعة بيانات COCO-Seg عدة نماذج YOLO26 لتجزئة الصور مدرّبة مسبقًا، وتختلف مقاييس أدائها. إليك ملخصًا للنماذج المتاحة وأبرز مقاييسها:
النموذج الحجم
(بكسل)mAPالصندوق50-95
(e2e)mAPالقناع50-95
(e2e)السرعة
CPU ONNX
(مللي ثانية)السرعة
T4 TensorRT10
(ms)المعاملات
(M)FLOPs
(B)YOLO26n-seg 640 39.6 33.9 53.3 ± 0.5 2.1 ± 0.0 2.7 9.3 YOLO26s-seg 640 47.3 40.0 118.4 ± 0.9 3.3 ± 0.0 10.4 34.5 YOLO26m-seg 640 52.5 44.1 328.2 ± 2.4 6.7 ± 0.1 23.6 121.7 YOLO26l-seg 640 54.4 45.5 387.0 ± 3.7 8.0 ± 0.1 28.0 140.1 YOLO26x-seg 640 56.5 47.0 787.0 ± 6.8 16.4 ± 0.1 62.8 314.0 تتراوح هذه النماذج بين YOLO26n-seg خفيف الوزن وYOLO26x-seg الأعلى دقة، وتوفر موازنات مختلفة بين السرعة والدقة لتلبية متطلبات التطبيقات المتنوعة.
تُقسَّم مجموعة بيانات COCO-Seg إلى ثلاث مجموعات فرعية لتلبية احتياجات التدريب والتقييم المحددة:
- Train2017: تتضمن 118,287 صورة تُستخدم أساسًا لتدريب نماذج تجزئة الكائنات.
- Val2017: تضم 5,000 صورة تُستخدم للتحقق أثناء عملية التدريب.
- Test-dev2017: تضم 20,288 صورة من أصل 40,670 صورة في test2017، وهي مخصصة لاختبار النماذج المدرّبة وقياس أدائها. يُرجى ملاحظة أن الشروح المرجعية الأساسية لهذه المجموعة الفرعية غير متاحة للعامة، وتُرسل نتائج الأداء إلى خادم تقييم COCO لتقييمها.
لإجراء تجارب أصغر نطاقًا، يمكنك أيضًا استخدام مجموعة بيانات COCO128-Seg (128 صورة) أو مجموعة بيانات COCO8-Seg، وهي نسخة مصغرة لا تضم سوى 8 صور من مجموعة COCO train 2017.
التعليقات10
اطرح سؤالًا، وشارك نتائجك، أو ساعد شخصًا آخر.
liujieKermit
what the label format if I want to train my custom dataset, please give the solution step by step like label, train, val, export, predict
Glenn JocherUltralytics(تم التعديل)@liujieKermit for custom segmentation training with YOLO26, follow these steps:
-
Label Format: Use YOLO segmentation format - one text file per image with class index and normalized polygon coordinates (minimum 3 points per object). Example:
<class> <x1> <y1> <x2> <y2> ... <xn> <yn> -
Dataset YAML: Create a YAML file (example
data.yaml):
path: /path/to/dataset train: images/train val: images/val names: 0: class1 1: class2- Train:
from ultralytics import YOLO model = YOLO('yolo26n-seg.pt') model.train(data='data.yaml', epochs=100, imgsz=640)- Export/Predict:
model.export(format='onnx') # export model.predict('image.jpg') # predictFor full details see our Dataset Format Guide and Auto-Annotation Tools. For commercial use, review our license terms.
-
YingdiZhang
Thanks for the great work. I am new to YOLO and AI. How to download the COCO dataset? is just running python coco.yaml?
Glenn JocherUltralytics(تم التعديل)@YingdiZhang to download the COCO dataset, you can run
yolo segment train data=coco.yamlin your terminal. This will automatically download the dataset for you. For more details, you can visit the Ultralytics documentation.
SacherTorte280
Dear developpers, I need to build a much simpler case where I'll only need <=5 labels, can I remove the others that i'll never use ?
Paula DerrengerUltralytics(تم التعديل)@SacherTorte280 yes, you can customize the dataset to include only the labels you need. To do this, modify the
coco.yamlfile to include only the desired classes in thenamessection and adjust the dataset paths accordingly. Also make sure the class indices in your label files are remapped to match the newnames(0 to N-1) and remove labels of the dropped classes. This will allow you to train your model with a simplified set of labels. For more details on configuring the dataset, please refer to the COCO-Seg documentation.
MoAbbasid
i get a list out of index error when running convert_coco function please help
Paula DerrengerUltralyticsHi there! It looks like you're encountering a
list index out of rangeerror with theconvert_cocofunction. This can often happen if the script is trying to access an element that doesn't exist in a list. To help you resolve this issue, please ensure that:- The data paths in your
coco.yamlconfig file are correctly set and point to valid files. - The COCO dataset is correctly downloaded and structured as expected by the script.
If the paths and dataset structure are correct, it might be helpful to check if the specific segment of data causing the error is formatted correctly or missing elements.
Here's a quick check you can perform:
try: # Assuming convert_coco is called here convert_coco() except IndexError as e: print("An index error occurred: ", e) # You can add more debugging information here to understand which part of the data is causing the problemThis snippet will catch the
IndexErrorand print it, potentially providing more insight on what's going wrong. If you need further assistance, please don't hesitate to share a snippet of the data or more details on the error!- The data paths in your
mohamed-ladjal
Greetings, I possess medical imagery depicting bone lesions. These images comprise 3D volumes of dimensions (256, 256, 128), with each volume containing 128 slices. Corresponding masks of identical dimensions are available. My objective is to either fine-tune or train a model using these slices to accurately segment the lesions mohamed mohamed.laadjel2019@gmail.com
Glenn JocherUltralytics(تم التعديل)Hello Mohamed,
Great to hear about your project on segmenting bone lesions from medical imagery! For your 3D volumes, you can approach this by treating each slice as a separate 2D image for segmentation.
Given your setup, you might consider using our YOLO26-seg models, which are well-suited for segmentation tasks. Here’s a basic example of how you could set up your training with YOLO26:
from ultralytics import YOLO # Load a pretrained segmentation model model = YOLO('yolo26n-seg.pt') # Choose the appropriate model size # Prepare your dataset in a compatible format # Ensure your dataset directory structure and annotations are correctly set up # Train the model results = model.train(data='your_dataset_config.yaml', epochs=100, imgsz=640)Make sure your dataset is annotated similarly to how COCO-Seg annotations are structured, with masks corresponding to each slice. You might need to adjust the
your_dataset_config.yamlto correctly point to your training, validation, and test images along with their annotations.For more detailed guidance on preparing your dataset and annotations, you can refer to our documentation on COCO-Seg Dataset.
If you have any more questions or need further assistance, feel free to ask. Happy training! 🚀



