Skip to content

Commit

Permalink
fixing annotation docs
Browse files Browse the repository at this point in the history
  • Loading branch information
brimoor committed Feb 7, 2022
1 parent 3be3db6 commit 544b304
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
3 changes: 3 additions & 0 deletions docs/source/_includes/substitutions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,6 @@

.. |InteractiveScatter| replace:: :class:`InteractiveScatter <fiftyone.core.plots.plotly.InteractiveScatter>`
.. |InteractiveHeatmap| replace:: :class:`InteractiveHeatmap <fiftyone.core.plots.plotly.InteractiveHeatmap>`

.. |AnnotationBackend| replace:: :class:`AnnotationBackend <fiftyone.utils.annotations.AnnotationBackend>`
.. |AnnotationBackendConfig| replace:: :class:`AnnotationBackendConfig <fiftyone.utils.annotations.AnnotationBackendConfig>`
24 changes: 10 additions & 14 deletions docs/source/user_guide/annotation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,7 @@ Configuring your backend

Annotation backends may be configured in a variety of backend-specific ways,
which you can see by inspecting the parameters of a backend's associated
:class:`AnnotationBackendConfig <fiftyone.utils.annotations.AnnotationBackendConfig>`
class.
|AnnotationBackendConfig| clas.

The relevant classes for the builtin annotation backends are:

Expand Down Expand Up @@ -700,9 +699,8 @@ default `label`.

Each annotation backend may support different `type` values, as declared by the
:meth:`supported_attr_types() <fiftyone.utils.annotations.AnnotationBackend.supported_attr_types>`
method of its
:class:`AnnotationBackend <fiftyone.utils.annotations.AnnotationBackend>` class.
For example, CVAT supports the following choices for `type`:
method of its |AnnotationBackend| class. For example, CVAT supports the
following choices for `type`:

- `text`: a free-form text box. In this case, `default` is optional and
`values` is unused
Expand Down Expand Up @@ -1006,18 +1004,17 @@ methods will use your custom backend.
Annotation backends are defined by writing subclasses of the following
three classes with the appropriate abstract methods implemented:

- :class:`AnnotationBackend <fiftyone.utils.annotations.AnnotationBackend>`:
this class implements the logic required for your annotation backend to
declare the types of labeling tasks that it supports, as well as the core
- |AnnotationBackend|: this class implements the logic required for your
annotation backend to declare the types of labeling tasks that it supports,
as well as the core
:meth:`upload_annotations() <fiftyone.utils.annotations.AnnotationBackend.upload_annotations>`
and
:meth:`download_annotations() <fiftyone.utils.annotations.AnnotationBackend.download_annotations>`
methods, which handle uploading and downloading data and labels to your
annotation tool

- :class:`AnnotationBackendConfig <fiftyone.utils.annotations.AnnotationBackendConfig>`:
this class defines the available parameters that users can pass as keyword
arguments to
- |AnnotationBackendConfig|: this class defines the available parameters that
users can pass as keyword arguments to
:meth:`annotate() <fiftyone.core.collections.SampleCollection.annotate>` to
customize the behavior of the annotation run

Expand All @@ -1043,7 +1040,7 @@ The recommended way to expose a custom backend is to add it to your
"default_backend": "<backend>",
"backends": {
"<backend>": {
"config_cls": "your.custom.AnnotationBackendConfigSubclass",
"config_cls": "your.custom.AnnotationBackendConfig",
# custom parameters here
...
Expand All @@ -1055,8 +1052,7 @@ In the above, `<backend>` defines the name of your custom backend, which you
can henceforward pass as the `backend` parameter to
:meth:`annotate() <fiftyone.core.collections.SampleCollection.annotate>`, and
the `config_cls` parameter specifies the fully-qualified name of the
:class:`AnnotationBackend <fiftyone.utils.annotations.AnnotationBackend>`
subclass for your annotation backend.
|AnnotationBackendConfig| subclass for your annotation backend.

With the `default_backend` parameter set to your custom backend as shown above,
calling
Expand Down

0 comments on commit 544b304

Please sign in to comment.