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