- Label of the annotation in the class taxonomy, e.g. shirt or dress
- Reference ID of the item to which to apply the annotation
- Name of the taxonomy that the label belongs to, optional but recommended
- Metadata, optional key-value pairs pertaining to the annotation, e.g. color = blue
CategoryAnnotations.
Taxonomies
To begin, we recommend manually creating and adding your own taxonomies to your datasets. This allows you to apply more than one category annotation (and prediction) to a single image, where each annotation pertains to a different taxonomy. By default, iftaxonomy_name is not provided in the CategoryAnnotation object, Nucleus will create a “default taxonomy” automatically based on the set of all unique labels in the uploaded annotation payload. If you continue to upload more CategoryAnnotations, new labels will automatically be added to the default taxonomy.
You can create a taxonomy and associate it with a dataset using Dataset.add_taxonomy:
CategoryAnnotation by taxonomy_name.
By setting update=True, you can add new labels to an existing taxonomy (e.g. from labels=["shirt", "trousers", "dress"] to labels=["shirt", "trousers", "dress", "jacket"]). We do not yet support changing or deleting existing labels, but this is coming soon! In the meantime, we recommend deleting the taxonomy and recreating it from scratch with the updated/removed labels. Note that deleting a taxonomy also deletes all annotations and predictions associated with it.
Single Category Annotations
For single-label categorization tasks, simply create oneCategoryAnnotation per image, per taxonomy. For instance, if you have 2 taxonomies clothing_type and designer and 100 images, you would create 200 annotations as follows:
Example Category Annotation Upload
Multi-Category Annotations
Currently, the best way to add multi-category annotations or predictions to an item is to use multiple taxonomies. Rather than a single taxonomy with N classes, you can add N binary taxonomies each with two classes: True or False. For example, consider a multi-category model predicting classes: shirt, trousers, and dress. You would first add three True/False taxonomies for each of the three classes. To add aCategoryAnnotation for an item of both the shirt and dress class, you would simply add True annotations for the shirt and dress taxonomies, and a False annotation for the trousers taxonomy.
Scene Category Annotations
Nucleus supports uploading and visualizing category annotations at the scene level. Like regular category annotations, aSceneCategoryAnnotation object contains a Label, Reference ID, Taxonomy Name, and Metadata.
To upload annotations for a scene (a video or a point cloud), begin by uploading all taxonomies present in your dataset as demonstrated earlier in this section.
Then, create a SceneCategoryAnnotation for a scene with a given reference_id the same way you would for a CategoryAnnotation.