CreateML json format

I'm trying to generate a json for my training data, tried manually first and then tried using roboflow and I still get the same error:

_annotations.createml.json file contains field "Index 0" that is not of type String.

the json format provided by roboflow was

[{"image":"menu1_jpg.rf.44dfacc93487d5049ed82952b44c81f7.jpg","annotations":[{"label":"100","coordinates":{"x":497,"y":431.5,"width":32,"height":10}}]}]

any help would be greatly appreciated

Answered by DTS Engineer in 807083022

Hello @Shakawkaw,

The JSON format for a Create ML object detector is documented on this page:

https://developer.apple.com/documentation/createml/building-an-object-detector-data-source

Your JSON has a couple issues, the "image" key is incorrect, it should be "imagefilename". Also, the "annotations" key is incorrect, it should be "annotation".

Here is a full example in the correct format:


[
    {
        "imagefilename": "example.png",
        "annotation": [
            {
                "label": "example",
                "coordinates": {
                    "x": 0,
                    "y": 0,
                    "width": 20,
                    "height": 30
                }
            }
        ]
    },
]

Best regards,

Greg

Accepted Answer

Hello @Shakawkaw,

The JSON format for a Create ML object detector is documented on this page:

https://developer.apple.com/documentation/createml/building-an-object-detector-data-source

Your JSON has a couple issues, the "image" key is incorrect, it should be "imagefilename". Also, the "annotations" key is incorrect, it should be "annotation".

Here is a full example in the correct format:


[
    {
        "imagefilename": "example.png",
        "annotation": [
            {
                "label": "example",
                "coordinates": {
                    "x": 0,
                    "y": 0,
                    "width": 20,
                    "height": 30
                }
            }
        ]
    },
]

Best regards,

Greg

Thank you so much was looking at other documentation page and was not finding anything related to the datasets, even those tools that claim paraing to CreateML are wrong. Ugh thanks again

CreateML json format
 
 
Q