COCO-Seg Veri Kümesi
COCO-Seg veri kümesi, Ultralytics YOLO etiket biçiminde 80 nesne kategorisine yayılan çokgen maskeleriyle 118.287 eğitim ve 5.000 doğrulama görüntüsünden oluşan COCO (Bağlam İçindeki Yaygın Nesneler) örnek segmentasyon maskeleri sağlar. COCO'nun özgün görüntülerini ve yerel segmentasyon açıklamalarını kullanır, bunları YOLO eğitimi için dönüştürür ve böylece örnek segmentasyonu görevlerinde çalışan araştırmacılar ve geliştiriciler için standart bir kaynak oluşturur.
COCO-Seg ile Önceden Eğitilmiş Modeller#
| Model | boyut (piksel) | mAPkutu50-95 (e2e) | mAPmaske50-95 (e2e) | Hız CPU ONNX (ms) | Hız T4 TensorRT10 (ms) | parametre (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 |
Temel Özellikler#
- COCO-Seg, COCO'nun yaklaşık 330 bin görüntülük daha geniş sürümünün içinden, etiketlenmiş 123.287 COCO train2017/val2017 görüntüsü (118.287 eğitim + 5.000 doğrulama) için örnek segmentasyonu maskeleri sunar.
- Veri kümesi, özgün COCO veri kümesindeki aynı 80 nesne kategorisinden oluşur.
- Açıklamalar, YOLO poligon etiketi biçiminde örnek segmentasyonu maskeleri sunar.
- COCO-Seg, örnek segmentasyonu performansını değerlendirmek için standartlaştırılmış mAP ve mAR metrikleri sunarak model performanslarının etkili biçimde karşılaştırılmasını sağlar.
- İndirme boyutu: İlk kullanımda ~20,3 GB (
train2017.zip+val2017.zip+ etiketler). 7 GB boyutundakitest2017.zipotomatik olarak indirilmez; çünkü bu görüntülerin temel doğruluk etiketleri gizlidir ve yalnızca test-dev2017 gönderimi için gerekir.
Veri Kümesi Yapısı#
COCO-Seg veri kümesi üç alt kümeye ayrılır:
- Train2017: Örnek segmentasyonu modellerini eğitmek için 118.287 görüntü.
- Val2017: Model geliştirme sırasında doğrulama için kullanılan 5.000 görüntü.
- Test-dev2017: 40.670 test2017 görüntüsünün kıyaslama için kullanılan 20.288'i. Bu alt kümenin temel gerçek açıklamaları herkese açık olmadığından puanlama için tahminlerin COCO değerlendirme sunucusuna gönderilmesi gerekir.
Daha küçük ölçekli denemeler için COCO128-Seg (128 görüntü) ve COCO8-Seg (8 görüntü) alt kümelerine göz at.
Uygulamalar#
COCO-Seg, YOLO modelleri gibi derin öğrenme modellerini örnek segmentasyonu konusunda eğitmek ve değerlendirmek için yaygın olarak kullanılır. Açıklama eklenmiş görüntülerin çokluğu, nesne kategorilerinin çeşitliliği ve standartlaştırılmış değerlendirme metrikleri, veri kümesini bilgisayarlı görü araştırmacıları ve uygulayıcıları için standart bir kaynak hâline getirir. COCO-Seg açıklamalarının tamamına Ultralytics Platform üzerinden de göz atabilir ve açıklamaları yönetebilirsin.
Veri Kümesi YAML Dosyası#
Veri kümesi yapılandırmasını tanımlamak için bir YAML dosyası kullanılır. Bu dosyada veri kümesinin yolları, sınıfları ve diğer ilgili bilgiler yer alır. COCO-Seg veri kümesi için coco.yaml dosyası https://github.com/ultralytics/ultralytics/blob/main/ultralytics/cfg/datasets/coco.yaml adresinde tutulur.
# 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)Kullanım#
COCO-Seg veri kümesinde 640 görüntü boyutuyla 100 epoch boyunca bir YOLO26n-seg modelini eğitmek için aşağıdaki kod parçacıklarını kullanabilirsin.
from ultralytics import YOLO
# Bir model yükle
model = YOLO("yolo26n-seg.pt") # Önceden eğitilmiş bir model yükle (eğitim için önerilir)
# Modeli eğit
results = model.train(data="coco.yaml", epochs=100, imgsz=640)Örnek Görüntüler ve Ek Açıklamalar#
COCO-Seg, COCO ile aynı çeşitlilikte görüntüler, nesne kategorileri ve karmaşık sahneler içerir; örnek segmentasyonu maskeleri YOLO etiket biçiminde sunulur. Aşağıda veri kümesindeki bazı görüntü örnekleri ve bunlara karşılık gelen örnek segmentasyonu maskeleri yer alıyor:

- Mozaiklenmiş görüntü: Bu görüntü, mozaiklenmiş veri kümesi görüntülerinden oluşan bir eğitim grubunu gösterir. Mozaikleme, her eğitim grubundaki nesne ve sahne çeşitliliğini artırmak için eğitim sırasında birden fazla görüntüyü tek bir görüntüde birleştiren bir tekniktir. Bu teknik, modelin farklı nesne boyutlarına, en-boy oranlarına ve bağlamlara genelleme yapmasına yardımcı olur.
Atıflar ve Teşekkürler#
COCO-Seg veri kümesini araştırma veya geliştirme çalışmalarında kullanıyorsan lütfen özgün COCO makalesine atıfta bulun ve COCO-Seg uzantısını belirt:
@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}
}Bilgisayarlı görü topluluğu için bu değerli kaynağı oluşturup sürdürdükleri için COCO Konsorsiyumu'na teşekkür ederiz.
Sık Sorulan Sorular#
COCO-Seg, COCO'nun (Bağlam İçindeki Yaygın Nesneler) aynı 118.287 train2017 ve 5.000 val2017 görüntüsüne ait yerel örnek segmentasyon maskelerinin Ultralytics YOLO biçiminde paketlenmiş hâlidir. Özgün COCO açıklamalarında 80 nesne kategorisinin tümü için bu çokgen maskeler zaten bulunur; COCO-Seg bunları nesne örneği segmentasyonu eğitimi için kullanılan YOLO etiket biçimine dönüştürür.
COCO-Seg veri kümesinde YOLO26n-seg modelini 640 görüntü boyutuyla 100 epoch boyunca eğitmek için aşağıdaki kod parçacıklarını kullanabilirsin. Kullanılabilir eğitim bağımsız değişkenlerinin ayrıntılı listesi için modelin Eğitim sayfasına başvur.
Eğitim Örneğifrom ultralytics import YOLO # Bir model yükle model = YOLO("yolo26n-seg.pt") # Önceden eğitilmiş bir model yükle (eğitim için önerilir) # Modeli eğit results = model.train(data="coco.yaml", epochs=100, imgsz=640)COCO-Seg veri kümesi bazı temel özellikler sunar:
- Etiketlenmiş 123.287 COCO train2017/val2017 görüntüsü için örnek segmentasyonu maskeleri sağlar (118.287 train + 5.000 val).
- Özgün COCO'daki 80 nesne kategorisinin aynısını açıklar.
- Örnek segmentasyonu maskelerini YOLO çokgen etiket biçiminde sağlar.
- Örnek segmentasyonu görevlerinde Ortalama Hassasiyet (mAP) ve Ortalama Geri Çağırma (mAR) gibi standartlaştırılmış değerlendirme metrikleri kullanır.
COCO-Seg veri kümesi, farklı performans ölçütlerine sahip birden fazla önceden eğitilmiş YOLO26 segmentasyon modelini destekler. Kullanılabilir modeller ve temel ölçütleri aşağıda özetlenmiştir:
Model boyut
(piksel)mAPkutu50-95
(e2e)mAPmaske50-95
(e2e)Hız
CPU ONNX
(ms)Hız
T4 TensorRT10
(ms)parametre
(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 Bu modeller, hafif YOLO26n-seg modelinden daha doğru YOLO26x-seg modeline kadar çeşitlilik gösterir ve farklı uygulama gereksinimlerine uyacak şekilde hız ve doğruluk arasında farklı ödünler sunar.
COCO-Seg veri kümesi, belirli eğitim ve değerlendirme ihtiyaçlarına yönelik üç alt kümeye ayrılır:
- Train2017: Öncelikli olarak örnek segmentasyonu modellerini eğitmek için kullanılan 118.287 görüntü içerir.
- Val2017: Eğitim sürecinde doğrulama için kullanılan 5.000 görüntüden oluşur.
- Test-dev2017: Eğitilmiş modelleri test etmek ve kıyaslamak için ayrılmış 40.670 test2017 görüntüsünün 20.288'ini içerir. Bu alt kümenin gerçek değer açıklamalarının herkese açık olmadığını ve performans sonuçlarının değerlendirme için COCO değerlendirme sunucusuna gönderildiğini unutma.
Daha küçük ölçekli denemeler için COCO128-Seg veri kümesini (128 görüntü) veya COCO train 2017 kümesinden yalnızca 8 görüntü içeren kompakt bir sürüm olan COCO8-Seg veri kümesini de değerlendirebilirsin.
Yorumlar10
Bir soru sor, sonuçlarını paylaş veya başka birine yardım et.
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(düzenlendi)@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(düzenlendi)@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(düzenlendi)@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(düzenlendi)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! 🚀



