Skip to main content
Label Spaces are the objects returned by LabelRowV2.get_spaces() and LabelRowV2.get_space(). Each Space manages the object and classification instances for one data unit within a Label Row, and every modality has its own Space class in the objects.spaces module. The examples below are grouped by the four labelling patterns the Space classes fall into. Pick the one that matches your data:
For the full end-to-end Data Group workflow (root spaces, multi-layer groups, layout_key targeting), see Data Groups & Label Spaces.

Get a Space

Every Space is obtained from an initialised Label Row. You can list all Spaces, or fetch a specific one by storage-item ID or Data Group layout_key.
get_space() requires the type_ argument so the SDK returns the correctly typed Space. Identify the Space using either:
  • A storage item’s unique ID: lr.get_space(id="7E3KERd9arYTiPicaijP6c1LfI73", type_="image")
  • A Data Group layout key: lr.get_space(layout_key="left-camera", type_="video")
Using layout_keys lets you reuse the same code across multiple Label Rows without looking up storage-item IDs.
List all Spaces in a Label Row

Shared Space methods

Every Space subclass inherits these read and remove methods from the base Space class, regardless of modality.

Image space (geometric, single-frame)

ImageSpace handles a single image. Objects are positioned with coordinates only — there is no frames argument. Classifications apply to the whole image.
ImageSpace
For bitmask objects, pass an Encord-compatible RLE string as the coordinates instead of a BoundingBoxCoordinates/polygon object. Convert COCO/pycocotools RLE first with encord.common.bitmask_operations.coco_rle_to_encord_rle.

Video space (multi-frame)

VideoSpace (also used for image sequences) and the other multi-frame spaces (MedicalSpace for DICOM/NIfTI, PdfSpace) require both frames= and coordinates=. Iterating annotations exposes the frame each annotation sits on.
VideoSpace
For DICOM/NIfTI use type_="medical", and for PDFs use type_="pdf" (where frames refers to the page number). The frames=/coordinates= call is identical.

Audio space (range)

Range spaces — AudioSpace, TextSpace, HTMLSpace, TimeSeriesSpace — position objects over one-dimensional ranges instead of frames. get_object_ranges() returns the ranges an instance occupies, and range on_overlap additionally supports "merge".
AudioSpace
TextSpace, HTMLSpace, and TimeSeriesSpace follow the same ranges= pattern. HTML uses HtmlRange/HtmlNode (from encord.objects.html_node import HtmlRange, HtmlNode) instead of Range.

Point cloud space

PointCloudFileSpace is a range space for 3D scenes. Segmentation objects are positioned either with Range objects over point indices or with an Encord-compatible RLE string. Its metadata is a SceneMetadata (exposing stream_id, uri, and event_index).
PointCloudFileSpace
on_overlap semantics differ by pattern: geometric and multi-frame spaces accept "error" (default) and "replace"; range and point cloud spaces additionally accept "merge" to add new ranges while keeping existing annotations.