Import annotations with CLI commands
A CLI how-to guide. SDK power-users can refer to our full SDK docs generated from our source code here
Once you've added data to a dataset in V7, you can use CLI commands to import existing annotations to the images and videos it contains.
Ensure your images and videos have been successfully uploaded and processed
Before you import annotations, make sure your target images and videos are marked as
New
, or have been previously annotated already.
Supported formats
The supported formats for importing annotations are Darwin, Pascal VOC, COCO, CSV Tags, CSV Video Tag, Labelbox, Super-Annotate, Dataloop and NIfTI
Enter the command below in the Command Prompt/Terminal. Replace team name with your team name in V7, dataset name with the name of your dataset, the format string for the annotations (in this example, we're using the darwin format) and /path/to/files/ with the path to the folder containing the annotation files on your device.
darwin dataset import team-slug/dataset-slug darwin /path/to/files/
If you're importing to dataset items with existing annotations, they will be overwritten by the import. In this case, you'll be presented with a warning:
Importing annotations...
Empty annotations will be skipped, if you want to delete annotations rerun with '--delete-for-empty'.
The following 4 dataset items already have annotations that will be overwritten by this import:
- dataset_item_1.jpg
- dataset_item_2.jpg
- dataset_item_3.jpg
- dataset_item_4.jpg
Do you want to proceed with the import? [y/N]
This warning can be bypassed by including the optional --overwrite argument in your import command:
darwin dataset import team-slug/dataset-slug darwin /path/to/files/ --overwrite
If you haven't added any classes to the dataset in V7, you'll receive the prompt below asking if they should be created:
2 classes are missing remotely
About to add the following classes
Class 1, Type: Class type
Class 2, Type: Class type
Do you want to continue [Y/N]
Enter Y to create any missing classes, and you're all set! When the import is complete, you should see all of your previous annotations added to your dataset.
Annotator and Reviewer Metadata
Two optional arguments allow you to maintain annotator metadata when importing annotations
--import-annotators
--import-reviewers
The annotator/review information should follow the format detailed on the Darwin JSON Format page under "authorship".
darwin dataset import team-slug/dataset-slug darwin /path/to/files --import-annotators --import-reviewers
Updated 6 months ago
The following guide teaches you how to import annotations from NIfTI files for volumetric data