COCO8-Grayscale Veri Kümesi
Giriş#
Ultralytics COCO8-Grayscale veri kümesi, COCO train 2017 kümesindeki ilk 8 görüntünün gri tonlamaya dönüştürülmüş hâlinden oluşan küçük bir nesne algılama veri kümesidir; 4 görüntü eğitim, 4 görüntü doğrulama içindir. Bu veri kümesi, YOLO gri tonlamalı modellerini ve eğitim işlem hatlarını hızlıca test etmek, hatalarını ayıklamak ve denemeler yapmak için özel olarak tasarlanmıştır. Küçük boyutu yönetimini kolaylaştırırken çeşitliliği, daha büyük veri kümelerine geçmeden önce etkili bir doğruluk kontrolü sunmasını sağlar.
İzle: Ultralytics YOLO Gri Tonlamalı ve Çok Spektrumlu Veri Kümelerinde Nasıl Eğitilir | Çok Kanallı VisionAI 🚀
Veri Kümesi Yapısı#
COCO8-Grayscale, COCO train 2017 kümesindeki ilk 8 görüntüden oluşan COCO8 veri kümesini temel alır; görüntüler 4'ü eğitim, 4'ü doğrulama için olacak şekilde ayrılmış ve 80 COCO sınıf adıyla etiketlenmiştir. Ancak her görüntü, YOLO etiket biçiminde tek kanallı (channels: 1) gri tonlamalı bir görüntü olarak saklanır:
coco8-grayscale/
├── images/
│ ├── train/ # 4 images
│ └── val/ # 4 images
└── labels/
├── train/
└── val/Her görüntüyü açıklama katmanlarıyla incelemek, Charts sekmesinde sınıf dağılımını ve sınırlayıcı kutu ısı haritalarını görüntülemek ve kendi modelini bulutta eğitmek üzere klonlamak için Ultralytics Platform'daki COCO8-Grayscale'i keşfet.
Veri Kümesi YAML Dosyası#
COCO8-Grayscale veri kümesi yapılandırması; veri kümesi yollarını, sınıf adlarını ve diğer temel meta verileri belirten bir YAML dosyasında tanımlanır. Resmî coco8-grayscale.yaml dosyasını Ultralytics GitHub deposunda inceleyebilirsin.
RGB görüntülerle gri tonlamada eğitim yapmak için veri kümesi YAML dosyana channels: 1 ekle. Bu, eğitim sırasında tüm görüntüleri gri tonlamaya dönüştürür; dolayısıyla ayrı bir gri tonlamalı veri kümesine ihtiyacın olmaz.
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
# COCO8-Grayscale dataset (first 8 images from COCO train2017) by Ultralytics
# Documentation: https://docs.ultralytics.com/datasets/detect/coco8-grayscale
# Example usage: yolo train data=coco8-grayscale.yaml
# parent
# ├── ultralytics
# └── datasets
# └── coco8-grayscale ← 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: coco8-grayscale # dataset root dir
train: images/train # train images (relative to 'path') 4 images
val: images/val # val images (relative to 'path') 4 images
test: # test images (optional)
channels: 1
# 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/coco8-grayscale.zipKullanım#
COCO8-Grayscale veri kümesi (1 MB), eğitime ilk başladığında otomatik olarak indirilir. COCO8-Grayscale üzerinde 640 görüntü boyutuyla 100 epoch boyunca bir YOLO26n modelini eğitmek için aşağıdaki örnekleri kullan.
from ultralytics import YOLO
# Önceden eğitilmiş bir YOLO26n modeli yükle
model = YOLO("yolo26n.pt")
# Modeli COCO8-Grayscale üzerinde eğit
results = model.train(data="coco8-grayscale.yaml", epochs=100, imgsz=640)Örnek Görüntüler ve Ek Açıklamalar#
Aşağıda COCO8-Grayscale veri kümesinden mozaiklenmiş bir eğitim grubu örneği yer alıyor:
- Mozaik Görüntü: Bu görüntü, her eğitim grubunda birden fazla veri kümesi görüntüsünün mozaik artırma kullanılarak birleştirilmesini gösterir. Mozaik artırma, her gruptaki nesne ve sahne çeşitliliğini artırarak modelin çeşitli nesne boyutlarına, en-boy oranlarına ve arka planlara daha iyi genelleme yapmasına yardımcı olur.
Bu teknik, eğitim sırasında her görüntünün değerini en üst düzeye çıkardığı için COCO8-Grayscale gibi küçük veri kümelerinde özellikle yararlıdır.
Atıflar ve Teşekkürler#
COCO veri kümesini araştırma veya geliştirme çalışmalarında kullanıyorsan lütfen aşağıdaki makaleye atıfta bulun:
@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ğuna süregelen katkıları için COCO Konsorsiyumuna ve bilgisayarlı görü topluluğuna özel teşekkürler.
Sık Sorulan Sorular#
Ultralytics COCO8-Grayscale veri kümesi, nesne algılama modellerini hızlıca test etmek ve hata ayıklamak için tasarlanmıştır. Yalnızca 8 görüntüden (4 eğitim, 4 doğrulama) oluştuğu için YOLO eğitim işlem hatlarını doğrulamak ve daha büyük veri kümelerine geçmeden önce her şeyin beklendiği gibi çalıştığından emin olmak için idealdir.
COCO8-Grayscale üzerinde bir YOLO26 modelini Python veya CLI kullanarak eğitebilirsin:
Eğitim Örneğifrom ultralytics import YOLO # Önceden eğitilmiş bir YOLO26n modeli yükle model = YOLO("yolo26n.pt") # Modeli COCO8-Grayscale üzerinde eğit results = model.train(data="coco8-grayscale.yaml", epochs=100, imgsz=640)Ek eğitim seçenekleri için YOLO Eğitim belgelerine bak.
COCO8-Grayscale eğitiminde kullanılan mozaik artırma, her batch sırasında birden fazla görüntüyü tek bir görüntüde birleştirir. Bu, nesne ve arka plan çeşitliliğini artırarak YOLO modelinin yeni senaryolara daha iyi genelleme yapmasına yardımcı olur. Mozaik artırma, her eğitim adımında mevcut bilgiyi en üst düzeye çıkardığından küçük veri kümeleri için özellikle değerlidir.
COCO8-Grayscale üzerinde eğitimden sonra YOLO26 modelini doğrulamak için modelin doğrulama komutlarını Python veya CLI üzerinden kullan. Bu işlem, modelinin performansını standart ölçütlerle değerlendirir. Adım adım talimatlar için YOLO Doğrulama belgelerini ziyaret et.
Yorumlar7
Bir soru sor, sonuçlarını paylaş veya başka birine yardım et.
arfan1181
Finally
1shkim-lp
Dear Ultralytics, Hello. I am a learner and a user of Ultralytics-YOLO Software. I am writing this post to ask questions about tracking Livestream color videos in grayscale.
At the moment, I am using Ultralytics for Classification/Segmentation/Tracking of my Livestream video. My livestream video contains 4 different types of connectors, which are moved by robots.
I have used the software well so far to classify/segment/track the 4 connectors in Livestream color video I tracked the Livestream video with
results = model.track(source="0", show=Trune, save=True), which displayed live results with "0" window. I was happy with the result.Now, I want to test the performance for a real scenario, where the Livestream camera will aceept only B/W images (The equipment has not been installed yet and I am trying to emulate future situation). I learned how to train models in B/W images with simple addition of channels = 1 . However, I still don't know how to track a Livestream video (where images are imported in color) in B/W scales and output them in B/W in "0" window.
Would there be an easy method to invoke results = model.track(source="0", show=Ture, save=True) , but classify/segment/track in B/W scale and output them in B/W as well?Thank you for your assistance!
Glenn JocherUltralyticsThere’s no built-in switch in
model.track(source=0, ...)to force grayscale preprocessing for a webcam stream, so the simplest way to emulate a B/W camera is to read frames with OpenCV, convert to grayscale, then replicate back to 3 channels (GRAY2BGR) so it works with any YOLO model, and display/save the result (training-side grayscale is covered on the COCO8-Grayscale dataset page).import cv2 from ultralytics import YOLO model = YOLO("best.pt") # your det/seg model cap = cv2.VideoCapture(0) while True: ok, frame = cap.read() if not ok: break gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) frame_bw3 = cv2.cvtColor(gray, cv2.COLOR_GRAY2BGR) # BW content, kept 3-channel results = model.track(source=frame_bw3, persist=True, verbose=False) annotated = results[0].plot() # BGR annotated_gray = cv2.cvtColor(annotated, cv2.COLOR_BGR2GRAY) cv2.imshow("0", annotated_gray) if cv2.waitKey(1) == 27: # ESC to quit break cap.release() cv2.destroyAllWindows()1shkim-lp
Thank you for such a prompt and precise answer!
Glenn JocherUltralyticsGlad it helped—if you end up training a
channels: 1model you can usually skipGRAY2BGRand feed the grayscale frame directly as(H, W)or(H, W, 1)(the loader will expand 2D grayscale to 1 channel), and feel free to drop any follow-up questions here so the Ultralytics team sees them (see the COCO8-Grayscale dataset docs).
zjjzeng
Hello, I did not notice this page before, so I trained my model on default rgb 3 channels and then predicted. Actually, all my native dataset images are gray images, I used a numpy operation to manually transfer it before training. I wonder that if I change channels to 1, will I be able to gain any improvements on my model. And do I need to modify both data.yaml and my customized yolo11n.yaml, right?
Glenn JocherUltralyticsGreat question—set channels: 1 in your dataset YAML and train; you don’t need to modify your custom yolo11n.yaml as the model’s first layer adapts automatically; if you previously replicated grayscale to 3 channels, accuracy differences are usually small while 1-channel can save memory, so a quick A/B run is the best way to confirm; for more on multi-channel handling, see the COCO8-Multispectral dataset page.



