datumaro icon indicating copy to clipboard operation
datumaro copied to clipboard

Subset is UNASSIGNED if you import original COCO dataset

Open warrkan opened this issue 1 month ago • 3 comments

When you use original COCO dataset (2017 split), it has structure:

  • images
    • train2017
    • test2017
    • val2017
  • annotations

If you try to import such dataset using import_coco_dataset from datumaro.experimental.data_formats.coco.io, all items have UNASSIGNED subset, in order to fix it you need to manually remove 2017 suffix everywhere. I think for 2014 split it will be the same.

Datumaro must support importing this dataset without extra actions required

warrkan avatar Oct 07 '26 09:10 warrkan

In theory, data_formats.coco.io is already supposed to handle the COCO2017 format:

dataset_root/
├── train2017/
│   ├── 0001.jpg
│   └── 0002.jpg
├── val2017/
│   ├── 1001.jpg
│   └── 1002.jpg
└── annotations/
    ├── instances_train2017.json
    └── instances_val2017.json

@A-Artemis could you please check:

  1. If you can reproduce the issue
  2. If there's anything wrong with import_coco_dataset that prevents COCO2017 from being correctly recognized.

For convenience, I recommend you to not use the full COCO dataset but a tiny one with the given layout.

leoll2 avatar Oct 12 '26 06:10 leoll2

In theory, data_formats.coco.io is already supposed to handle the COCO2017 format:

dataset_root/
├── train2017/
│   ├── 0001.jpg
│   └── 0002.jpg
├── val2017/
│   ├── 1001.jpg
│   └── 1002.jpg
└── annotations/
    ├── instances_train2017.json
    └── instances_val2017.json

@A-Artemis could you please check:

  1. If you can reproduce the issue
  2. If there's anything wrong with import_coco_dataset that prevents COCO2017 from being correctly recognized.

For convenience, I recommend you to not use the full COCO dataset but a tiny one with the given layout.

Here train2017 and val2017 must be placed into images folder as per https://cocodataset.org/#download - the images and annotations should go in coco/images/ and coco/annotations/

warrkan avatar Oct 12 '26 08:10 warrkan

I was able to reproduce, this issue was that it always defaulted to UNASSIGNED since the train/val/test folder names are compared as-is.

A-Artemis avatar Oct 15 '26 08:10 A-Artemis