module documentation

Utilities for working with annotations in Label Studio.

Copyright 2017-2025, Voxel51, Inc.

Class LabelStudioAnnotationAPI A class to upload tasks and predictions to and fetch annotations from Label Studio.
Class LabelStudioAnnotationResults Class that stores all relevant information needed to monitor the progress of an annotation run sent to Label Studio and download the results.
Class LabelStudioBackend Class for interacting with the Label Studio annotation backend.
Class LabelStudioBackendConfig Class for configuring LabelStudioBackend instances.
Function export_label_to_label_studio Exports a label to the Label Studio format.
Function generate_labeling_config Generates a labeling config for a Label Studio project.
Function import_label_studio_annotation Imports an annotation from Label Studio.
Variable brush Undocumented
Variable etree Undocumented
Variable logger Undocumented
Variable ls Undocumented
Function _check_type Undocumented
Function _denormalize_values Undocumented
Function _from_brushlabels Undocumented
Function _from_choices Undocumented
Function _from_keypointlabels Undocumented
Function _from_number Undocumented
Function _from_polygonlabels Undocumented
Function _from_rectanglelabels Undocumented
Function _generate_prediction_id Undocumented
Function _get_label_ids Undocumented
Function _label_class_from_tag Maps Label Studio parent tag to FiftyOne Label type.
Function _ls_tags_from_type Maps fiftyone types to Label Studio tags.
Function _normalize_values Undocumented
Function _result_type Undocumented
Function _tag_from_label Undocumented
Function _to_classification Undocumented
Function _to_detection Undocumented
Function _to_instance Undocumented
Function _to_keypoint Undocumented
Function _to_polyline Undocumented
Function _to_regression Undocumented
Function _to_segmentation Undocumented
Function _update_dict Undocumented
Constant _LABEL_TO_TYPE Undocumented
Constant _LABEL_TYPES Undocumented
def export_label_to_label_studio(label, label_type=None, full_result=None): (source)

Exports a label to the Label Studio format.

Parameters
labela fiftyone.core.labels.Label or list of fiftyone.core.labels.Label instances
label_type:Nonethe label type to use when exporting the annotation. This argument is only used when exporting object detections. By default, only the bounding boxes are exported, but you can pass label_type="instances" to export them as brush labels encoding the instance masks instead
full_result:Noneif non-empty, return the full Label Studio result
Returns
a dictionary or a list in Label Studio format
def generate_labeling_config(label_schema, media): (source)

Generates a labeling config for a Label Studio project.

Parameters
label_schemaUndocumented
mediaThe media type to label
label_shemadict defining each label type
Returns
a labeling config
def import_label_studio_annotation(result): (source)

Imports an annotation from Label Studio.

Parameters
resultthe annotation result from Label Studio
Returns
a fiftyone.core.labels.Label

Undocumented

Undocumented

Undocumented

Undocumented

def _check_type(label, label_type, label_type_multiple): (source)

Undocumented

def _denormalize_values(values): (source)

Undocumented

def _from_brushlabels(result): (source)

Undocumented

def _from_choices(result): (source)

Undocumented

def _from_keypointlabels(result): (source)

Undocumented

def _from_number(result): (source)

Undocumented

def _from_polygonlabels(result): (source)

Undocumented

def _from_rectanglelabels(result): (source)

Undocumented

def _generate_prediction_id(n=10): (source)

Undocumented

def _get_label_ids(label): (source)

Undocumented

def _label_class_from_tag(label_type): (source)

Maps Label Studio parent tag to FiftyOne Label type.

def _ls_tags_from_type(label_type): (source)

Maps fiftyone types to Label Studio tags.

Parameters
label_typelabel studio type
Returns
A tuple of parent tag, child tag and parent_tag kwargs
def _normalize_values(values): (source)

Undocumented

def _result_type(result): (source)

Undocumented

def _tag_from_label(label_cls): (source)

Undocumented

def _to_classification(label): (source)

Undocumented

def _to_detection(label): (source)

Undocumented

def _to_instance(label, size): (source)

Undocumented

def _to_keypoint(label): (source)

Undocumented

def _to_polyline(label): (source)

Undocumented

def _to_regression(label): (source)

Undocumented

def _to_segmentation(label): (source)

Undocumented

def _update_dict(src_dict, update_dict): (source)

Undocumented

_LABEL_TO_TYPE = (source)

Undocumented

Value
{v['label'].__name__: k for k, v in _LABEL_TYPES.items()}
_LABEL_TYPES = (source)

Undocumented

Value
{'classification': dict(parent_tag='Choices',
                        child_tag='Choice',
                        label=fol.Classification,
                        tag_kwargs={'choice': 'single-radio'}),
 'classifications': dict(parent_tag='Choices',
                         child_tag='Choice',
                         label=fol.Classification,
...