class LabelStudioAnnotationAPI(foua.AnnotationAPI): (source)
Constructor: LabelStudioAnnotationAPI(url, api_key)
A class to upload tasks and predictions to and fetch annotations from Label Studio.
On initialization, the class will check if the server is reachable.
Method | __init__ |
Undocumented |
Method | delete |
Deletes the project from Label Studio. |
Method | delete |
Deletes the given tasks from Label Studio. |
Method | download |
Downloads the annotations from the Label Studio server for the given results instance and parses them into the appropriate FiftyOne types. |
Method | upload |
Uploads the given predictions to an existing Label Studio project. |
Method | upload |
Uploads the given samples to Label Studio according to the given backend's annotation and server configuration. |
Instance Variable | backend |
Undocumented |
Instance Variable | url |
Undocumented |
Static Method | _get |
Undocumented |
Method | _export |
Undocumented |
Method | _import |
Undocumented |
Method | _init |
Creates a new project on Label Studio. |
Method | _prepare |
Prepares Label Studio tasks for the given data. |
Method | _setup |
Undocumented |
Method | _upload |
Uploads files to Label Studio and registers them as tasks. |
Method | _verify |
Undocumented |
Instance Variable | _api |
Undocumented |
Instance Variable | _client |
Undocumented |
Instance Variable | _min |
Undocumented |
Inherited from AnnotationAPI
:
Method | __enter__ |
Undocumented |
Method | __exit__ |
Undocumented |
Method | close |
Closes the API session. |
Method | _prompt |
Undocumented |
Method | _prompt |
Undocumented |
Downloads the annotations from the Label Studio server for the given results instance and parses them into the appropriate FiftyOne types.
Parameters | |
results | a LabelStudioAnnotationResults |
Returns | |
the annotations dict |
Uploads the given predictions to an existing Label Studio project.
Parameters | |
project | a label_studio_sdk.Project |
tasks | a list of task dicts |
sample | a list or list of lists of
fiftyone.core.labels.Label instances |
label | the label type string |
Uploads the given samples to Label Studio according to the given backend's annotation and server configuration.
Parameters | |
samples | a fiftyone.core.collections.SampleCollection |
anno | the annotation key |
backend | a LabelStudioBackend to use to perform the upload |
Returns | |
a LabelStudioAnnotationResults |
Creates a new project on Label Studio.
If project_name is not set in the configs, it will be generated. If project_name exists on the server, a timestamp will be added to the project name.
Parameters | |
config | a LabelStudioBackendConfig |
samples | a fiftyone.core.collections.SampleCollection |
Returns | |
a label_studio_sdk.Project |
Uploads files to Label Studio and registers them as tasks.
Parameters | |
project | a label_studio_sdk.Project |
tasks | a list of task dicts |
predictions:None | optional predictions to upload |
Returns | |
a dict mapping task_id to sample_id |