Annotation utilities.
Class |
|
Base class for APIs that connect to annotation backends. |
Class |
|
Base class for annotation backends. |
Class |
|
Base class for configuring an AnnotationBackend instances. |
Class |
|
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. |
Class |
|
No summary |
Function | annotate |
Exports the samples and optional label field(s) to the given annotation backend. |
Function | connect |
Returns an API instance connected to the annotation backend. |
Function | draw |
Renders an annotated version of the sample's image with the specified label data overlaid to disk. |
Function | draw |
Renders annotated versions of the images in the collection with the specified label data overlaid to the given directory. |
Function | draw |
Renders an annotated version of the sample's video with the specified label data overlaid to disk. |
Function | draw |
Renders annotated versions of the videos in the collection with the specified label data overlaid to the given directory. |
Function | load |
Downloads the labels from the given annotation run from the annotation backend and merges them into the collection. |
Variable | logger |
Undocumented |
Function | _build |
Undocumented |
Function | _ensure |
Undocumented |
Function | _flatten |
Undocumented |
Function | _format |
Undocumented |
Function | _get |
Undocumented |
Function | _get |
Undocumented |
Function | _get |
Undocumented |
Function | _get |
Undocumented |
Function | _get |
Undocumented |
Function | _get |
Undocumented |
Function | _get |
Undocumented |
Function | _get |
Undocumented |
Function | _get |
Undocumented |
Function | _get |
Undocumented |
Function | _get |
Undocumented |
Function | _handle |
Undocumented |
Function | _init |
Undocumented |
Function | _is |
Undocumented |
Function | _merge |
Undocumented |
Function | _merge |
Undocumented |
Function | _merge |
Undocumented |
Function | _parse |
Undocumented |
Function | _parse |
Undocumented |
Function | _parse |
Undocumented |
Function | _parse |
Undocumented |
Function | _prompt |
Undocumented |
Function | _select |
Undocumented |
Function | _to |
Undocumented |
Function | _to |
Undocumented |
Function | _to |
Undocumented |
Function | _unwrap |
Undocumented |
Function | _update |
Undocumented |
Constant | _DEFAULT |
Undocumented |
Constant | _LABEL |
Undocumented |
Constant | _LABEL |
Undocumented |
Constant | _RETURN |
Undocumented |
Constant | _SPATIAL |
Undocumented |
Constant | _SPATIAL |
Undocumented |
Constant | _TRACKABLE |
Undocumented |
Exports the samples and optional label field(s) to the given annotation backend.
The backend parameter controls which annotation backend to use.
Depending on the backend you use, you may want/need to provide extra
keyword arguments to this function for the constructor of the backend's
AnnotationBackendConfig
class.
The natively provided backends and their associated config classes are:
- "cvat":
fiftyone.utils.cvat.CVATBackendConfig
- "labelstudio":
fiftyone.utils.labelstudio.LabelStudioBackendConfig
- "labelbox":
fiftyone.utils.labelbox.LabelboxBackendConfig
See :ref:`this page <requesting-annotations>` for more information about using this method, including how to define label schemas and how to configure login credentials for your annotation provider.
Parameters | |
samples | a fiftyone.core.collections.SampleCollection |
anno | a string key to use to refer to this annotation run |
labelNone | a dictionary defining the label schema to use. If this argument is provided, it takes precedence over the other schema-related arguments |
labelNone | a string indicating a new or existing label field to annotate |
labelNone | a string indicating the type of labels to annotate. The possible values are:
All new label fields must have their type specified via this argument or in label_schema. Note that annotation backends may not support all label types |
classes:None | a list of strings indicating the class options for label_field or all fields in label_schema without classes specified. All new label fields must have a class list provided via one of the supported methods. For existing label fields, if classes are not provided by this argument nor label_schema, the observed labels on your dataset are used |
attributes:True | specifies the label attributes of each label field to include (other than their label, which is always included) in the annotation export. Can be any of the following:
If a label_schema is also provided, this parameter determines which attributes are included for all fields that do not explicitly define their per-field attributes (in addition to any per-class attributes) |
maskNone | a dict mapping pixel values to semantic label strings. Only applicable when annotating semantic segmentations. All new label fields must have mask targets provided via one of the supported methods. For existing label fields, if mask targets are not provided by this argument nor label_schema, any applicable mask targets stored on your dataset will be used, if available |
allowTrue | whether to allow new labels to be added. Only applicable when editing existing label fields |
allowTrue | whether to allow labels to be deleted. Only applicable when editing existing label fields |
allowTrue | whether to allow the label attribute of existing labels to be modified. Only applicable when editing existing fields with label attributes |
allowTrue | whether to allow the index attribute of existing video tracks to be modified. Only applicable when editing existing frame fields with index attributes |
allowTrue | whether to allow edits to the spatial properties (bounding boxes, vertices, keypoints, masks, etc) of labels. Only applicable when editing existing spatial label fields |
media | the field containing the paths to the media files to upload |
backend:None | the annotation backend to use. The supported values are fiftyone.annotation_config.backends.keys() and the default is fiftyone.annotation_config.default_backend |
launchFalse | whether to launch the annotation backend's editor after uploading the samples |
**kwargs | keyword arguments for the AnnotationBackendConfig
subclass of the backend being used |
Returns | |
an AnnotationResults |
Returns an API instance connected to the annotation backend.
Some annotation backends may not expose this functionality.
Parameters | |
backend:None | the annotation backend to use. The supported values are fiftyone.annotation_config.backends.keys() and the default is fiftyone.annotation_config.default_backend |
**kwargs | keyword arguments for the AnnotationBackendConfig
subclass of the backend being used |
Returns | |
an AnnotationAPI |
Renders an annotated version of the sample's image with the specified label data overlaid to disk.
Parameters | |
sample | a fiftyone.core.sample.Sample |
outpath | the path to write the annotated image |
labelNone | a label field or list of label fields to render. If omitted, all compatible fields are rendered |
config:None | an optional DrawConfig configuring how to draw
the labels |
**kwargs | optional keyword arguments specifying parameters of the
default DrawConfig to override |
Renders annotated versions of the images in the collection with the specified label data overlaid to the given directory.
The filenames of the sample images are maintained, unless a name conflict would occur in output_dir, in which case an index of the form "-%d" % count is appended to the base filename.
The images are written in format fo.config.default_image_ext.
Parameters | |
samples | a fiftyone.core.collections.SampleCollection |
output | the directory to write the annotated images |
relNone | an optional relative directory to strip from each input
filepath to generate a unique identifier that is joined with
output_dir to generate an output path for each annotated image.
This argument allows for populating nested subdirectories in
output_dir that match the shape of the input paths. The path is
converted to an absolute path (if necessary) via
fiftyone.core.storage.normalize_path |
labelNone | a label field or list of label fields to render. If omitted, all compatible fields are rendered |
config:None | an optional DrawConfig configuring how to draw
the labels |
progress:None | whether to render a progress bar (True/False), use the default value fiftyone.config.show_progress_bars (None), or a progress callback function to invoke instead |
**kwargs | optional keyword arguments specifying parameters of the
default DrawConfig to override |
Returns | |
the list of paths to the labeled images |
Renders an annotated version of the sample's video with the specified label data overlaid to disk.
Parameters | |
sample | a fiftyone.core.sample.Sample |
outpath | the path to write the annotated image |
support:None | an optional [first, last] range of frames to render |
labelNone | a label field or list of label fields to render. If omitted, all compatible fields are rendered |
config:None | an optional DrawConfig configuring how to draw
the labels |
**kwargs | optional keyword arguments specifying parameters of the
default DrawConfig to override |
Renders annotated versions of the videos in the collection with the specified label data overlaid to the given directory.
The filenames of the videos are maintained, unless a name conflict would occur in output_dir, in which case an index of the form "-%d" % count is appended to the base filename.
The videos are written in format fo.config.default_video_ext.
Parameters | |
samples | a fiftyone.core.collections.SampleCollection |
output | the directory to write the annotated videos |
relNone | an optional relative directory to strip from each input
filepath to generate a unique identifier that is joined with
output_dir to generate an output path for each annotated video.
This argument allows for populating nested subdirectories in
output_dir that match the shape of the input paths. The path is
converted to an absolute path (if necessary) via
fiftyone.core.storage.normalize_path |
labelNone | a label field or list of label fields to render. If omitted, all compatible fields are rendered |
config:None | an optional DrawConfig configuring how to draw
the labels |
progress:None | whether to render a progress bar (True/False), use the default value fiftyone.config.show_progress_bars (None), or a progress callback function to invoke instead |
**kwargs | optional keyword arguments specifying parameters of the
default DrawConfig to override |
Returns | |
the list of paths to the labeled videos |
Downloads the labels from the given annotation run from the annotation backend and merges them into the collection.
See :ref:`this page <loading-annotations>` for more information about
using this method to import annotations that you have scheduled by calling
annotate
.
Parameters | |
samples | a fiftyone.core.collections.SampleCollection |
anno | an annotation key |
destNone | an optional name of a new destination field into which to load the annotations, or a dict mapping field names in the run's label schema to new destination field names |
unexpected:"prompt" | how to deal with any unexpected labels that don't match the run's label schema when importing. The supported values are:
|
cleanup:False | whether to delete any informtation regarding this run from the annotation backend after loading the annotations |
progress:None | whether to render a progress bar (True/False), use the default value fiftyone.config.show_progress_bars (None), or a progress callback function to invoke instead |
**kwargs | keyword arguments for the run's
fiftyone.core.annotation.AnnotationMethodConfig.load_credentials
method |
Returns | |
None, unless unexpected=="return" and unexpected labels are found, in which case a dict containing the extra labels is returned |
Undocumented
Undocumented
Undocumented
Undocumented
Undocumented
Undocumented
Undocumented
Undocumented
Value |
|
Undocumented
Value |
|
Undocumented
Value |
|
Undocumented
Value |
|