class AnnotationBackend(foa.AnnotationMethod): (source)
Known subclasses: fiftyone.utils.cvat.CVATBackend
, fiftyone.utils.labelbox.LabelboxBackend
, fiftyone.utils.labelstudio.LabelStudioBackend
Constructor: AnnotationBackend(*args, **kwargs)
Base class for annotation backends.
Parameters | |
config | an AnnotationBackendConfig |
Method | __enter__ |
Undocumented |
Method | __exit__ |
Undocumented |
Method | __init__ |
Undocumented |
Method | connect |
Returns an API instance connected to the annotation backend. |
Method | download |
Downloads the annotations from the annotation backend for the given results. |
Method | get |
Gets the fields that were involved in the given run. |
Method | recommend |
Recommends an attribute tool for an attribute with the given name and value. |
Method | requires |
Determines whether the list of possible values are required for attributes of the given type. |
Method | upload |
Uploads the samples and relevant existing labels from the label schema to the annotation backend. |
Method | use |
Registers an API instance to use for subsequent operations. |
Property | requires |
Whether this backend requires a pre-defined label schema for its annotation runs. |
Property | supported |
The list of attribute types supported by the backend. |
Property | supported |
The list of label types supported by the backend. |
Property | supported |
The list of media types that this backend supports. |
Property | supported |
The list of scalar field types supported by the backend. |
Property | supports |
Whether this backend supports annotating clips views. |
Property | supports |
Whether this backend supports uploading only keyframes when editing existing video track annotations. |
Property | supports |
Whether this backend supports annotating video labels at a sample-level. |
Method | _connect |
Returns a new API instance connected to the annotation backend. |
Instance Variable | _api |
Undocumented |
Inherited from AnnotationMethod
:
Class Method | run |
The BaseRunInfo class associated with this class. |
Class Method | _patch |
A function that can patch any ReferenceField issues with a dataset's runs. |
Class Method | _results |
The fiftyone.core.dataset.Dataset field that stores the results cache for these runs. |
Class Method | _run |
A string to use when referring to these runs in log messages. |
Class Method | _runs |
The fiftyone.core.odm.dataset.DatasetDocument field in which these runs are stored. |
Inherited from BaseRun
(via AnnotationMethod
):
Class Method | delete |
Deletes the results associated with the given run key from the collection. |
Class Method | delete |
Deletes all runs from the collection. |
Class Method | get |
Gets the BaseRunInfo for the given key on the collection. |
Class Method | has |
Determines whether BaseRunResults for the given key are cached on the collection. |
Class Method | list |
Returns the list of run keys on the given collection. |
Class Method | load |
Loads the BaseRunResults for the given key on the collection. |
Class Method | load |
Loads the fiftyone.core.view.DatasetView on which the specified run was performed. |
Class Method | save |
Saves the run information on the collection. |
Class Method | save |
Saves the run results on the collection. |
Class Method | update |
Updates the BaseRunConfig for the given run on the collection. |
Class Method | update |
Replaces the key for the given run with a new key. |
Method | cleanup |
Cleans up the results of the run with the given key from the collection. |
Method | ensure |
Ensures that any necessary packages to execute this run are installed. |
Method | ensure |
Ensures that any necessary packages to use existing results for this run are installed. |
Method | register |
Registers a run of this method under the given key on the given collection. |
Method | rename |
Performs any necessary operations required to rename this run's key. |
Method | validate |
Validates that the collection can accept this run. |
Class Method | _get |
Undocumented |
Class Method | _get |
Undocumented |
Class Method | _get |
Undocumented |
Method | _validate |
Undocumented |
Method | _validate |
Subclass-specific validation when a run with the given key already exists. |
Inherited from Configurable
(via AnnotationMethod
, BaseRun
):
Instance Variable | config |
Undocumented |
Returns an API instance connected to the annotation backend.
Existing API instances are reused, if available.
Some annotation backends may not expose this functionality.
Returns | |
an AnnotationAPI , or None if the backend does not
expose an API |
fiftyone.utils.cvat.CVATBackend
, fiftyone.utils.labelbox.LabelboxBackend
, fiftyone.utils.labelstudio.LabelStudioBackend
Downloads the annotations from the annotation backend for the given results.
The returned labels should be represented as either scalar values or
fiftyone.core.labels.Label
instances.
For image datasets, the return dictionary should have the following nested structure:
# Scalar fields results[label_type][sample_id] = scalar # Label fields results[label_type][sample_id][label_id] = label
For video datasets, the returned labels dictionary should have the following nested structure:
# Scalar fields results[label_type][sample_id][frame_id] = scalar # Label fields results[label_type][sample_id][frame_id][label_id] = label
The valid values for label_type are:
- "classifications": single or multilabel classifications
- "detections": detections or instance segmentations
- "polylines": polygons or polylines
- "segmentation": semantic segmentations
- "scalar": scalar values
Parameters | |
results | an AnnotationResults |
Returns | |
the labels results dict |
fiftyone.core.runs.BaseRun.get_fields
Gets the fields that were involved in the given run.
Parameters | |
samples | a fiftyone.core.collections.SampleCollection |
anno | Undocumented |
key | a run key |
Returns | |
a list of fields |
Recommends an attribute tool for an attribute with the given name and value.
For example, a backend may recommend a tool as follows for a boolean value:
{ "type": "radio", "values": [False, True], }
or a tool as follows for a generic value:
{"type": "text"}
Parameters | |
name | the name of the attribute |
value | the attribute value, which may be None |
Returns | |
an attribute type dict |
Determines whether the list of possible values are required for attributes of the given type.
Parameters | |
attr | the attribute type string |
Returns | |
True/False |
fiftyone.utils.cvat.CVATBackend
, fiftyone.utils.labelbox.LabelboxBackend
, fiftyone.utils.labelstudio.LabelStudioBackend
Uploads the samples and relevant existing labels from the label schema to the annotation backend.
Parameters | |
samples | a fiftyone.core.collections.SampleCollection |
anno | the annotation key |
launchFalse | whether to launch the annotation backend's editor after uploading the samples |
Returns | |
an AnnotationResults |
fiftyone.utils.cvat.CVATBackend
, fiftyone.utils.labelbox.LabelboxBackend
, fiftyone.utils.labelstudio.LabelStudioBackend
Whether this backend requires a pre-defined label schema for its annotation runs.
fiftyone.utils.cvat.CVATBackend
, fiftyone.utils.labelbox.LabelboxBackend
, fiftyone.utils.labelstudio.LabelStudioBackend
The list of attribute types supported by the backend.
This list defines the valid string values for the type field of an attributes dict of the label schema provided to the backend.
For example, CVAT supports ["text", "select", "radio", "checkbox"].
fiftyone.utils.cvat.CVATBackend
, fiftyone.utils.labelbox.LabelboxBackend
, fiftyone.utils.labelstudio.LabelStudioBackend
The list of label types supported by the backend.
Backends may support any subset of the following label types:
- "classification"
- "classifications"
- "detection"
- "detections"
- "instance"
- "instances"
- "polyline"
- "polylines"
- "polygon"
- "polygons"
- "keypoint"
- "keypoints"
- "segmentation"
- "scalar"
fiftyone.utils.cvat.CVATBackend
, fiftyone.utils.labelbox.LabelboxBackend
, fiftyone.utils.labelstudio.LabelStudioBackend
The list of media types that this backend supports.
For example, CVAT supports ["image", "video"].
fiftyone.utils.cvat.CVATBackend
, fiftyone.utils.labelbox.LabelboxBackend
, fiftyone.utils.labelstudio.LabelStudioBackend
The list of scalar field types supported by the backend.
For example, CVAT supports the following types:
fiftyone.utils.cvat.CVATBackend
, fiftyone.utils.labelbox.LabelboxBackend
, fiftyone.utils.labelstudio.LabelStudioBackend
Whether this backend supports uploading only keyframes when editing existing video track annotations.
fiftyone.utils.cvat.CVATBackend
, fiftyone.utils.labelbox.LabelboxBackend
, fiftyone.utils.labelstudio.LabelStudioBackend
Whether this backend supports annotating video labels at a sample-level.
fiftyone.utils.cvat.CVATBackend
, fiftyone.utils.labelbox.LabelboxBackend
, fiftyone.utils.labelstudio.LabelStudioBackend
Returns a new API instance connected to the annotation backend.
Returns | |
an AnnotationAPI , or None if the backend does not
expose an API |