XAMI-dataset / Datasets-Structure.md
iulia-elisa's picture
Upload 8 files
33871a9 verified
|
raw
history blame
1.34 kB

Datasets-Structure

(YOLOv8 format)

The Yolov8 dataset for segmentation is usually structured as follows:

yolo_dataset/
β”‚
β”œβ”€β”€ train/
β”‚ β”œβ”€β”€ images/
β”‚ β”‚ └── πŸ–ΌοΈ img_n # Example image 
β”‚ β”‚
β”‚ └── labels/
β”‚   └── πŸ“„ img_n_labels.txt # Example labels file 
β”‚
β”œβ”€β”€ valid/
β”‚ β”‚ ... (similar)
β”‚
└── πŸ“„ data.yaml

Each img_x_labels.txt file contains multiple annotations (one per line) with corresponding class ID and segmentation coordinates:

<class-index> <x1> <y1> <x2> <y2> ... <xn> <yn>

The file data.yaml contains keys such as:

  • names (the class names)
  • nc (number or classes)
  • train (path/to/train/images/)
  • val (path/to/val/images/)

(COCO Instance Segmentation format)

coco_dataset/
β”‚
β”œβ”€β”€ train/
β”‚  β”œβ”€β”€ πŸ–ΌοΈ img_n # Example image 
β”‚  └── πŸ“„ annotations.json # The annotations json file
β”‚
└── valid/ 
   └── ... (similar)

The annotations json file contains a dictionary of lists:

  • images (a list of dictionaries)

    • id - image ID
    • file_name
    • height
    • width
  • annotations (a list of dictionaries)

    • id
    • image_id
    • category_id
    • bbox
    • area
    • segmentation (a segmentation polygon)
    • iscrowd
  • categories (a list of dictionaries)

    • id
    • name