# MDVD-108K Annotation Format MDVD-108K keeps the original VisDrone-style detection labels in the release package. YOLO and COCO labels are not stored by default; they can be generated from the provided scripts when needed. The conversion scripts use only the Python standard library. ## Directory Layout Synthetic subsets keep degradation folders: ```text train/{degradation}/input/*.jpg train/{degradation}/gt/*.jpg train/{degradation}/label/*.txt val/{degradation}/input/*.jpg test/{degradation}/input/*.jpg ``` The real subset is flattened in the public `MDVD-108K` package: ```text real/input/00001.jpg real/label/00001.txt ``` ## Label Fields Each label file is a comma-separated text file. One line represents one object or ignored region: ```text bbox_left,bbox_top,bbox_width,bbox_height,score,object_category,truncation,occlusion ``` Field meanings: | Field | Meaning | | --- | --- | | `bbox_left` | left pixel coordinate | | `bbox_top` | top pixel coordinate | | `bbox_width` | box width in pixels | | `bbox_height` | box height in pixels | | `score` | `1` for valid object labels; `0` marks ignored regions | | `object_category` | VisDrone category id | | `truncation` | truncation flag/level from VisDrone | | `occlusion` | occlusion flag/level from VisDrone | Ignored regions are lines with `score <= 0` or `object_category <= 0`. They are kept in the native labels for fidelity, but are skipped by default when generating YOLO/COCO labels. ## Categories | id | name | | ---: | --- | | 0 | ignored_regions | | 1 | pedestrian | | 2 | people | | 3 | bicycle | | 4 | car | | 5 | van | | 6 | truck | | 7 | tricycle | | 8 | awning_tricycle | | 9 | bus | | 10 | motor | | 11 | others | ## Generate YOLO Labels YOLO uses normalized `class x_center y_center width height` labels. Class ids are converted from VisDrone `1-11` to YOLO `0-10`. ```bash python tools/convert_mdvd_to_yolo.py \ --dataset-root /path/to/MDVD-108K \ --output-dir /path/to/MDVD-108K_yolo \ --image-mode symlink ``` The generated YOLO directory contains: ```text MDVD-108K_yolo/ images/{train,val,test,real}/... labels/{train,val,test,real}/... data.yaml ``` Use `--image-mode none` to generate labels only. ## Generate COCO Labels COCO labels are generated as one JSON file per split. Bounding boxes remain in pixel-space `[x, y, width, height]`. The original `score`, `truncation`, and `occlusion` fields are preserved under each annotation's `attributes`. ```bash python tools/convert_mdvd_to_coco.py \ --dataset-root /path/to/MDVD-108K \ --output-dir /path/to/MDVD-108K_coco ``` Outputs: ```text MDVD-108K_coco/ instances_train.json instances_val.json instances_test.json instances_real.json ``` By default ignored regions are skipped. Add `--include-ignored` if you want to keep them as `category_id=0` annotations with `ignore=1`.