Get Label Spaces
The following script gets all Label Spaces in Label Row and prints their IDs.Get All Label Space IDs
Get & Update Labels
Use the following scripts to get all annotations in a Label Space. The script shows how annotations can be updated by changing thelast_edited_by and annotation coordinates for each annotation in the Label Space.
Ensure that you replace:
- All variables in the
User inputsection at the top of the script. - The names of objects in your Ontology.
- The type and position of the label(s).
Add Labels
The following scripts add a single object with an attribute, and a classification to two different Label Spaces.Attributes are set on the object instance itself, so the same attribute values apply across all Label Spaces the instance is added to.
- All variables in the
User inputsection at the top of the script. - The names of objects in your Ontology.
- The type and position of the label(s).
Remove Labels
The following scripts remove an object from a Label Space. Ensure that you replace:- All variables in the
User inputsection at the top of the script. - The names of objects in your Ontology.
- The type and position of the label(s).
Put It All Together
The following is an example demonstrating how to use Label Spaces. We have Data Groups with five data units in the following layout:Create Example Data Groups
The following script creates the Data Groups and specifies the layout.Create Data Group
Pre-label Data Groups
We want to pre-label the classifications for all videos with the layout_keytop-left in the Data Groups with Yes. This way annotators only need to update the classification for top-left videos where there the model predictions and summaries are incorrect.
Our example Project uses a Dataset that contains our Data Groups. The Ontology looks like this:
Classifications
-
Prediction correct?YES!(Radio button)No(Radio button)What's wrong?(Text)
-
Summary correct?YES!(Radio button)No(Radio button)What's wrong?(Text)
Import Classification values on top_left videos
Accessing Storage Item Metadata With Label Spaces
Label spaces provide a direct link to their storage items using thespace_id property. It maps to the uuid of the corresponding StorageItem.
space.space_id is equivalent to the uuid of the storage item. This holds for all label spaces, not just image Data Groups.get_spaces() on a label row to traverse from a label space to its storage item and access all metadata such as image dimensions. The following example demonstrates this using a Data Group of plain images, fetching the height and width of each image through its label space:
Get image dimensions from storage item

