class AnnotationResults(foa.AnnotationResults): (source)
Known subclasses: fiftyone.utils.cvat.CVATAnnotationResults
, fiftyone.utils.labelbox.LabelboxAnnotationResults
, fiftyone.utils.labelstudio.LabelStudioAnnotationResults
Constructor: AnnotationResults(samples, config, anno_key, id_map, backend)
Base class for storing the intermediate results of an annotation run that has been initiated and is waiting for its results to be merged back into the FiftyOne dataset.
The id_map dictionary must record the IDs of any existing labels that are being edited by the annotation run. Any new label fields do not need to have keys in this dictionary.
For image datasets, id_map should have the following format:
{ "<label-field>": { "<sample-id>": "label-id" or ["label-id", ...], ... }, ... }
For video datasets, id_map should have the following format:
{ "<label-field>": { "<sample-id>": { "<frame-id>": label-id" or ["label-id", ...], ... }, ... }, ... }
When editing scalar fields, set the dictionary values corresponding to uploaded scalars to True (since scalars do not have IDs).
If a particular sample or frame was included in the annotation run but no labels/scalars were uploaded for editing, the corresponding entry in id_map can be either missing or have a value of None.
Note
This class is serialized for storage in the database by calling
serialize
.
Any public attributes of this class are included in the representation
generated by serialize
, so they must be JSON serializable.
Parameters | |
samples | a fiftyone.core.collections.SampleCollection |
config | an AnnotationBackendConfig |
anno | the annotation key |
id | a dictionary recording the existing label IDs, in the format described above |
backend | an AnnotationBackend |
Method | __enter__ |
Undocumented |
Method | __exit__ |
Undocumented |
Method | __init__ |
Undocumented |
Method | cleanup |
Deletes all information for this run from the annotation backend. |
Method | connect |
Returns an API instance connected to the annotation backend. |
Method | launch |
Launches the annotation backend's editor for these results. |
Method | use |
Registers an API instance to use for subsequent operations. |
Instance Variable | id |
Undocumented |
Class Method | _from |
Builds an AnnotationResults from a JSON dict representation of it. |
Method | _finalize |
Internal method that is (only) called prior to saving annotation results for the first time. |
Method | _format |
Undocumented |
Method | _sample |
Undocumented |
Method | _to |
Undocumented |
Method | _to |
Undocumented |
Method | _update |
Adds the given label IDs into this object's id_map . |
Property | _is |
Whether this annotation run was perfromed on a clips view. |
Property | _is |
Whether this annotation run was perfromed on a frames view. |
Inherited from BaseRunResults
(via AnnotationResults
):
Class Method | from |
Builds a BaseRunResults from a JSON dict representation of it. |
Static Method | base |
Returns the results class for the given run type. |
Method | attributes |
Returns the list of class attributes that will be serialized by serialize . |
Method | save |
Saves the results to the database. |
Method | save |
Saves these results config to the database. |
Property | cls |
The fully-qualified name of this BaseRunResults class. |
Property | config |
The BaseRunConfig for these results. |
Property | key |
The run key for these results. |
Property | samples |
The fiftyone.core.collections.SampleCollection associated with these results. |
Instance Variable | _backend |
Undocumented |
Instance Variable | _config |
Undocumented |
Instance Variable | _key |
Undocumented |
Instance Variable | _samples |
Undocumented |
fiftyone.utils.cvat.CVATAnnotationResults
, fiftyone.utils.labelbox.LabelboxAnnotationResults
, fiftyone.utils.labelstudio.LabelStudioAnnotationResults
Deletes all information for this run from the annotation backend.
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.CVATAnnotationResults
, fiftyone.utils.labelbox.LabelboxAnnotationResults
, fiftyone.utils.labelstudio.LabelStudioAnnotationResults
Launches the annotation backend's editor for these results.
fiftyone.utils.cvat.CVATAnnotationResults
, fiftyone.utils.labelbox.LabelboxAnnotationResults
, fiftyone.utils.labelstudio.LabelStudioAnnotationResults
Builds an AnnotationResults
from a JSON dict representation
of it.
Parameters | |
d | a JSON dict |
samples | the fiftyone.core.collections.SampleCollection
for the run |
config | the AnnotationBackendConfig for the run |
anno | the annotation key |
Returns | |
an AnnotationResults |
Adds the given label IDs into this object's id_map
.
For image datasets, new_id_map should have the following format:
{ "<sample-id>": "label-id" or ["label-id", ...], ... },
For video datasets, new_id_map should have the following format:
{ "<sample-id>": { "<frame-id>": label-id" or ["label-id", ...], ... }, ... }
Parameters | |
label | the label field |
new | a dictionary in the format described above |