How do I import an Encord dataset?

Solved it. Here’s the steps I took:

  1. Add a new supercategory to the categories array.
    Roboflow uses the ā€œAnnotation groupā€ name you input at the time of project creation as a supercategory for other categories, while Encord just uses a bounding-box supercategory. The former is added into the categories array with id 0, while the latter isn’t in the categories array to begin with. The Roboflow supercategory has "none" as a supercategory itself. This is how your categories array should look like:
  "categories": [
    { "supercategory": "none", "id": 0, "name": "stuff" }, // the actual name of your annotation group here
    { "supercategory": "stuff", "id": 1, "name": "foo" },
    { "supercategory": "stuff", "id": 2, "name": "bar" }
  ]
  1. Delete all "file_name" lines. Encord’s COCO JSON has the original file name in "image_title", which is useless, and a generated random filename in "file_name". Ctrl+F in VSCode, check Regular Expression search, input ^.*"file_name".* in Find, and Replace All with an empty string to delete all of the useless file names. Then, Find "image_title" and Replace All with "file_name", so you get the "file_name" pointing to the actual file name.
  2. Put this JSON next to all your images and upload by selecting the folder. The annotated ones should go into the Annotated tab. I named my JSON labels.coco.json, I don’t know if that holds any relevance.

I hope in the future Roboflow takes care of this automatically without user intervention. I also wish the documentation regarding annotation imports was more transparent. All they tell you is that Roboflow can magically import everything, but there’s no concrete specification of each format and how you should set up files correctly for importing.

1 Like