open-mmlab/mmtracking

KeyError: 'categories'

CXF66 opened this issue · 0 comments

I'm trying to prepare YouTube-VIS dataset. The data structure in "dataset.md" is:

│ ├── youtube_vis_2019
│ │ │── train
│ │ │ │── JPEGImages
│ │ │ │── ......
│ │ │── valid
│ │ │ │── JPEGImages
│ │ │ │── ......
│ │ │── test
│ │ │ │── JPEGImages
│ │ │ │── ......
│ │ │── train.json (the official annotation files)
│ │ │── valid.json (the official annotation files)
│ │ │── test.json (the official annotation files)

But actually the data structure I have got is:

│ ├── youtube_vis_2019
│ │ │── train
│ │ │ │── JPEGImages
│ │ │ │── Annotations
│ │ │ │── meta.json
│ │ │── valid
│ │ │ │── JPEGImages
│ │ │ │── ......
│ │ │── test
│ │ │ │── JPEGImages
│ │ │ │── ......

I didn't know which is "train.json (the official annotation files)". Then I thought maybe "meta.json" in the train folder was "train.json". So I modified the data structure:

│ ├── youtube_vis_2019
│ │ │── train
│ │ │ │── JPEGImages
│ │ │ │── ......
│ │ │── valid
│ │ │ │── JPEGImages
│ │ │ │── ......
│ │ │── test
│ │ │ │── JPEGImages
│ │ │ │── ......
│ │ │── train.json ("meta.json" in the train folder)
│ │ │── valid.json ("meta.json" in the valid folder)
│ │ │── test.json ("meta.json" in the test folder)

Then when I run "python ./tools/convert_datasets/youtubevis/youtubevis2coco.py", the reported error was KeyError: 'categories'. Line 54 in "youtubevis2coco.py" is VIS['categories'] = copy.deepcopy(official_anns['categories']), but my "train.json" doesn't contain 'categories'.
So how can I get the true "train.json"? Could you help me? Thanks!