Link to this sectionCOCO12-Formats Datensatz#
Link to this sectionEinführung#
Der Ultralytics COCO12-Formats Datensatz ist ein spezieller Testdatensatz, der entwickelt wurde, um das Laden von Bildern über 12 unterstützte Bildformaterweiterungen hinweg zu validieren. Er enthält 12 Bilder (6 für das Training, 6 für die Validierung), die jeweils in einem anderen Format gespeichert sind, um ein umfassendes Testen der Bildladepipeline zu gewährleisten.
Dieser Datensatz ist von unschätzbarem Wert für:
- Testen der Bildformatunterstützung: Überprüfe, ob gängige Bildformate korrekt geladen werden
- CI/CD-Pipelines: Automatisierte Tests der Formatkompatibilität
- Debugging: Isoliere formatspezifische Probleme in Trainingspipelines
- Entwicklung: Validierung neuer Formatergänzungen oder -änderungen
Link to this sectionUnterstützte Formate#
Der Datensatz enthält ein Bild für jede der 12 unterstützten Formaterweiterungen, die in ultralytics/data/utils.py definiert sind:
| Format | Erweiterung | Beschreibung | Train/Val |
|---|---|---|---|
| AVIF | .avif | AV1 Image File Format (modern) | Trainieren |
| BMP | .bmp | Bitmap - unkomprimiertes Rasterformat | Trainieren |
| DNG | .dng | Digital Negative - Adobe RAW-Format | Trainieren |
| HEIC | .heic | High Efficiency Image Coding | Trainieren |
| JPEG | .jpeg | JPEG mit voller Erweiterung | Trainieren |
| JPG | .jpg | JPEG mit kurzer Erweiterung | Trainieren |
| JP2 | .jp2 | JPEG 2000 - medizinisch/geospazial | Validieren |
| MPO | .mpo | Multi-Picture Object (Stereo-Bilder) | Validieren |
| PNG | .png | Portable Network Graphics | Validieren |
| TIF | .tif | TIFF mit kurzer Erweiterung | Validieren |
| TIFF | .tiff | Tagged Image File Format | Validieren |
| WebP | .webp | Modernes Web-Bildformat | Validieren |
Link to this sectionDatensatzstruktur#
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 sectionDatensatz-YAML#
Der COCO12-Formats Datensatz wird über eine YAML-Datei konfiguriert, die Datensatzpfade und Klassennamen definiert. Du kannst die offizielle coco12-formats.yaml Datei im Ultralytics GitHub-Repository einsehen.
# 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 sectionAnforderungen#
Einige Formate erfordern zusätzliche Abhängigkeiten:
pip install pillow pillow-heif pillow-avif-pluginLink to this sectionAVIF Systembibliothek (optional)#
Damit OpenCV AVIF-Dateien direkt lesen kann, muss libavif vor dem Erstellen von OpenCV installiert werden:
brew install libavifDas via pip installierte opencv-python Paket enthält möglicherweise keine AVIF-Unterstützung, da es vorkompiliert ist. Ultralytics verwendet Pillow mit pillow-avif-plugin als Fallback für AVIF-Bilder, wenn OpenCV keine Unterstützung bietet.
Link to this sectionVerwendung#
Um ein YOLO Modell auf dem COCO12-Formats Datensatz zu trainieren, verwende die folgenden Beispiele:
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 sectionFormatspezifische Hinweise#
Link to this sectionAVIF (AV1 Image File Format)#
AVIF ist ein modernes Bildformat basierend auf dem AV1 Videocodec, das eine exzellente Komprimierung bietet. Erfordert pillow-avif-plugin:
pip install pillow-avif-pluginLink to this sectionDNG (Digital Negative)#
DNG ist Adobes offenes RAW-Format basierend auf TIFF. Zu Testzwecken verwendet der Datensatz TIFF-basierte Dateien mit der .dng Erweiterung.
Link to this sectionJP2 (JPEG 2000)#
JPEG 2000 ist ein Wavelet-basierter Bildkomprimierungsstandard, der eine bessere Komprimierung und Qualität als herkömmliches JPEG bietet. Häufig verwendet in der medizinischen Bildgebung (DICOM), geospazialen Anwendungen und digitalem Kino. Nativ unterstützt von OpenCV und Pillow.
Link to this sectionMPO (Multi-Picture Object)#
MPO-Dateien werden für stereoskopische (3D) Bilder verwendet. Der Datensatz speichert Standard-JPEG-Daten mit der .mpo Erweiterung für Formattests.
Link to this sectionHEIC (High Efficiency Image Coding)#
HEIC erfordert das pillow-heif Paket für die korrekte Kodierung:
pip install pillow-heifLink to this sectionAnwendungsfälle#
Link to this sectionCI/CD-Tests#
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 sectionFormat-Validierung#
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 sectionZitate und Danksagungen#
Wenn du den COCO Datensatz in deiner Forschung verwendest, zitiere bitte:
@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 sectionFAQ#
Link to this sectionWofür wird der COCO12-Formats Datensatz verwendet?#
Der COCO12-Formats Datensatz wurde für das Testen der Bildformatkompatibilität in Ultralytics YOLO Trainingspipelines entwickelt. Er stellt sicher, dass 12 unterstützte Bildformate (AVIF, BMP, DNG, HEIC, JP2, JPEG, JPG, MPO, PNG, TIF, TIFF, WebP) korrekt geladen und verarbeitet werden.
Link to this sectionWarum mehrere Bildformate testen?#
Unterschiedliche Bildformate haben einzigartige Eigenschaften (Kompression, Farbtiefe, Farbräume). Das Testen aller Formate stellt sicher:
- Robuster Code zum Laden von Bildern
- Kompatibilität über verschiedene Datensätze hinweg
- Frühzeitige Erkennung formatspezifischer Fehler
Link to this sectionWelche Formate erfordern spezielle Abhängigkeiten?#
- AVIF: Erfordert
pillow-avif-plugin - HEIC: Erfordert
pillow-heif