This guide assumes your files were already imported into Encord and a Project containing the data has been created.
-
Save
import.py, replacing the following variables:SSH_PATHwith the full path to your private key.PROJECT_IDwith the unique ID of the Project containing the data units you want to import labels for.COCOimportfile.jsonwith the full path of the COCO file containing the labels you want to import.
- If necessary, modify the matching logic that maps COCO image IDs to Encord frame indices. This is particularly important in cases where filenames in the COCO file do not directly match those in the Encord Project or when multiple files have the same name.
import.py script is configured to import labels into single images with unique names and assumes that the category names in the COCO file match the names of your Ontology objects. It matches each COCO image’s file_name to the title of a data unit in the Project. COCO files exported from Encord also include image_title or video_title fields, and the script uses those when they are present.
In practice, you must implement your own matching logic. An example where filenames in the COCO file do not directly match those in the Encord Project is provided below.

