Skip to content

KeyError: 'images' when executing coco2yolov5 #8

@TortoiseFather

Description

@TortoiseFather

Following the instructions on the collab notebook on a simplified version of the following dataset https://www.wilddash.cc/railsem19 containing a single image and cocojson file I get the error 'KeyError: 'images''

My files are structured as follows:
PyProject > Babyrs19 > rs00001.json / rs00001.jpg

My code is as follows:

rom pylabel import importer
path_to_annotations = 'Babyrs19/rs00001.json'
path_to_images = ''
dataset = importer.ImportCoco(path_to_annotations, path_to_images=path_to_images, name="BCCD_coco")
dataset.df.head(5)

My full error is as follows

Traceback (most recent call last):
  File "D:\Work\PyProject\main.py", line 9, in <module>
    dataset = importer.ImportCoco(path_to_annotations, path_to_images=path_to_images, name="BCCD_coco")
  File "D:\Work\PyProject\venv\lib\site-packages\pylabel\importer.py", line 61, in ImportCoco
    images = pd.json_normalize(annotations_json["images"])
KeyError: 'images'

I have tried referencing the whole folder within path_to_annotations, I have tried referencing the image within path_to_images, I have tried with multiple images, I cannot get anything to work. Please help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions