콘텐츠로 건너뛰기

COCO12-포맷 데이터셋

소개

The Ultralytics COCO12-Formats 데이터셋은 지원되는 12가지 이미지 형식 확장자 전반에 걸친 이미지 로딩을 검증하기 위해 설계된 특수 테스트 데이터셋입니다. 이미지 로딩 파이프라인의 포괄적인 테스트를 보장하기 위해 각기 다른 형식으로 저장된 12개의 이미지(훈련용 6개, 검증용 6개)를 포함합니다.

이 데이터셋은 다음에 있어 매우 소중합니다:

  • 이미지 형식 지원 테스트: 지원되는 모든 형식이 올바르게 로드되는지 확인하십시오.
  • CI/CD 파이프라인: 형식 호환성 자동 테스트
  • 디버깅: 훈련 파이프라인에서 형식별 문제 격리
  • 개발: 새로운 형식 추가 또는 변경 사항 검증

지원되는 형식

이 데이터셋에는 정의된 12개의 지원되는 형식 확장자 각각에 대해 하나의 이미지가 포함됩니다. ultralytics/data/utils.py:

형식확장자설명트레인/발
AVIF.avifAV1 이미지 파일 형식 (현대식)Train
BMP.bmp비트맵 - 압축되지 않은 래스터 형식Train
DNG.dng디지털 네거티브 - Adobe RAW 형식Train
HEIC.heic고효율 영상 코딩Train
JPEG.jpeg확장자를 포함한 JPEGTrain
JPG.jpg짧은 확장자를 가진 JPEGTrain
JP2.jp2JPEG 2000 - 의료/지리공간Val
MPO.mpo다중 이미지 객체 (스테레오 이미지)Val
PNG.pngPortable Network GraphicsVal
TIF.tif짧은 확장자를 가진 TIFFVal
TIFF.tiff태그된 이미지 파일 형식Val
WebP.webp현대적인 웹 이미지 형식Val

데이터 세트 구조

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 configuration

데이터세트 YAML

COCO12-Formats 데이터셋은 데이터셋 경로와 클래스 이름을 정의하는 YAML 파일을 사용하여 구성됩니다. 공식 문서를 참조할 수 있습니다. coco12-formats.yaml 파일을 Ultralytics GitHub 저장소.

ultralytics.yaml

# 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.zip

데이터 세트 생성

제공된 스크립트를 사용하여 데이터셋을 생성할 수 있으며, 이 스크립트는 COCO8 COCO128 소스 이미지를 모든 지원되는 COCO128 변환합니다:

from ultralytics.data.scripts.generate_coco12_formats import generate_coco12_formats

# Generate the dataset
generate_coco12_formats()

요구 사항

일부 형식은 추가 종속성이 필요합니다:

pip install pillow pillow-heif pillow-avif-plugin

AVIF 시스템 라이브러리 (선택 사항)

OpenCV AVIF 파일을 직접 OpenCV , libavif 설치되어야 합니다 이전 OpenCV 빌드:

brew install libavif
sudo apt install libavif-dev libavif-bin
git clone -b v1.2.1 https://github.com/AOMediaCodec/libavif.git
cd libavif
cmake -B build -DAVIF_CODEC_AOM=SYSTEM -DAVIF_BUILD_APPS=ON
cmake --build build --config Release --parallel
sudo cmake --install build

참고

pip 설치된 opencv-python 패키지는 사전 빌드된 것이므로 AVIF 지원을 포함하지 않을 수 있습니다. Ultralytics Pillow를 Ultralytics . pillow-avif-plugin OpenCV AVIF 이미지 지원을 OpenCV 때의 대체 방안으로.

사용법

COCO12-Formats 데이터셋에서 YOLO 훈련하려면 다음 예시를 사용하십시오:

훈련 예제

from ultralytics import YOLO

# Load a pretrained YOLO model
model = YOLO("yolo26n.pt")

# Train on COCO12-Formats to test all image formats
results = model.train(data="coco12-formats.yaml", epochs=1, imgsz=640)
# Train YOLO on COCO12-Formats
yolo detect train data=coco12-formats.yaml model=yolo26n.pt epochs=1 imgsz=640

서식별 참고 사항

AVIF (AV1 이미지 파일 형식)

AVIF는 AV1 비디오 코덱을 기반으로 한 현대적인 이미지 포맷으로, 우수한 압축률을 제공합니다. pillow-avif-plugin:

pip install pillow-avif-plugin

DNG (디지털 네거티브)

DNG는 TIFF를 기반으로 한 Adobe의 오픈 RAW 형식입니다. 테스트 목적으로, 데이터셋은 TIFF 기반 파일을 사용하며 .dng 확장.

JP2 (JPEG 2000)

JPEG 2000은 기존 JPEG보다 우수한 압축률과 화질을 제공하는 웨이블릿 기반 이미지 압축 표준입니다. 의료 영상(DICOM), 지리 공간 애플리케이션, 디지털 시네마 분야에서 널리 사용됩니다. OpenCV Pillow 모두에서 기본적으로 지원됩니다.

MPO (다중 이미지 객체)

MPO 파일은 입체(3D) 이미지에 사용됩니다. 이 데이터 세트는 표준 JPEG 데이터를 저장하며 .mpo 포맷 테스트용 확장 기능.

HEIC (고효율 이미지 코딩)

HEIC는 다음을 필요로 합니다. pillow-heif 적절한 인코딩을 위한 패키지:

pip install pillow-heif

사용 사례

CI/CD 테스트

from ultralytics import YOLO


def test_all_image_formats():
    """Test that all image formats load correctly."""
    model = YOLO("yolo26n.pt")
    results = model.train(data="coco12-formats.yaml", epochs=1, imgsz=64)
    assert results is not None

형식 유효성 검사

from pathlib import Path

from ultralytics.data.utils import IMG_FORMATS

# Verify all formats are represented
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"Missing formats: {IMG_FORMATS - found_formats}"

인용 및 감사의 말씀

연구에 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}
}

FAQ

COCO12-Formats 데이터셋은 무엇에 사용됩니까?

COCO12-Formats 데이터셋은 Ultralytics YOLO 파이프라인에서 이미지 형식 호환성을 테스트하기 위해 설계되었습니다. 이 데이터셋은 지원되는 12가지 이미지 형식(AVIF, BMP, DNG, HEIC, JP2, JPEG, JPG, MPO, PNG, TIF, TIFF, WebP)이 모두 올바르게 로드되고 처리되도록 보장합니다.

왜 여러 이미지 형식을 테스트해야 할까요?

다양한 이미지 형식은 고유한 특성(압축, 비트 심도, 색 공간)을 지닙니다. 모든 형식을 테스트하면 다음을 보장합니다:

  • 견고한 이미지 로딩 코드
  • 다양한 데이터 세트 간의 호환성
  • 형식별 버그의 조기 발견

어떤 형식이 특별한 종속성을 필요로 하나요?

  • AVIF필요함 pillow-avif-plugin
  • HEIC필요함 pillow-heif

새로운 형식의 시험을 추가할 수 있나요?

네! 수정하세요. generate_coco12_formats.py 추가 형식을 포함하도록 스크립트를 수정하십시오. 또한 업데이트를 확인하십시오. IMG_FORMATS 에서 ultralytics/data/utils.py.



5; 0 전에 생성됨 ✏️ 0 전에 업데이트됨
glenn-jocher

댓글