Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions docs/source/superannotate.sdk.rst
Original file line number Diff line number Diff line change
Expand Up @@ -323,18 +323,13 @@ ________________________
.. _ref_aggregate_annotations_as_df:
.. autofunction:: superannotate.aggregate_annotations_as_df
.. autofunction:: superannotate.df_to_annotations
.. _ref_filter_annotation_instances:
.. autofunction:: superannotate.filter_annotation_instances
.. autofunction:: superannotate.filter_images_by_comments
.. autofunction:: superannotate.filter_images_by_tags

----------

Aggregating class/attribute distribution from annotations
Aggregating class distribution from annotations
_____________________________________________________________

.. autofunction:: superannotate.class_distribution
.. autofunction:: superannotate.attribute_distribution

----------

Expand Down
21 changes: 0 additions & 21 deletions docs/source/tutorial.sdk.rst
Original file line number Diff line number Diff line change
Expand Up @@ -453,16 +453,6 @@ Example of created DataFrame:
Each row represents annotation information. One full annotation with multiple
attribute groups can be grouped under :code:`instanceId` field.

A helper function :ref:`filter_annotation_instances <ref_filter_annotation_instances>` is available to filter annotation instances by their class, attribute, type or error fields from the DataFrame. E.g., to get annotations that have annotation class :code:`Human` and attribute :code:`"height" : "tall"` that are **not** of type :code:`polygon`:

.. code-block:: python

filtered_df = sa.filter_annotation_instances(df, include=[{"className" : "Human",
"attributes" : [{"groupName" : "height",
"name" : "tall"}]
}],
exclude=[{"type" : "polygon"}])

To transform back pandas DataFrame annotations to SuperAnnotate format annotation:

.. code-block:: python
Expand Down Expand Up @@ -490,17 +480,6 @@ Aggregated distribution is returned as pandas dataframe with columns className a

.. image:: class_distribution.png


Similarly aggregation of class attributes across multiple projects can be obtained with

.. code-block:: python

df = sa.attribute_distribution("<path_to_export_folder>", [project_names], visualize = True)

Here pandas DataFrame with columns identifying attribute and corresponding instance count is returned. Within visualized histogram attributes of the same class are grouped by color and sorted accordingly.

.. image:: attribute_distribution.png

----------


Expand Down
13 changes: 1 addition & 12 deletions src/superannotate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import requests
import superannotate.lib.core as constances
from packaging.version import parse
from superannotate.lib.app.analytics.class_analytics import attribute_distribution
from superannotate.lib.app.analytics.class_analytics import class_distribution
from superannotate.lib.app.annotation_helpers import add_annotation_bbox_to_json
from superannotate.lib.app.annotation_helpers import add_annotation_comment_to_json
Expand All @@ -23,13 +22,7 @@
from superannotate.lib.app.input_converters.conversion import export_annotation
from superannotate.lib.app.input_converters.conversion import import_annotation
from superannotate.lib.app.input_converters.df_converter import df_to_annotations
from superannotate.lib.app.input_converters.df_converter import (
filter_annotation_instances,
)
from superannotate.lib.app.input_converters.df_converter import (
filter_images_by_comments,
)
from superannotate.lib.app.input_converters.df_converter import filter_images_by_tags

from superannotate.lib.app.input_converters.dicom_converter import dicom_to_rgb_sequence
from superannotate.lib.app.interface.sdk_interface import add_annotation_bbox_to_image
from superannotate.lib.app.interface.sdk_interface import (
Expand Down Expand Up @@ -175,7 +168,6 @@
"init",
"set_auth_token",
# analytics
"attribute_distribution",
"class_distribution",
"aggregate_annotations_as_df",
"get_exports",
Expand All @@ -189,9 +181,6 @@
"import_annotation",
"export_annotation",
"convert_project_type",
"filter_images_by_comments",
"filter_images_by_tags",
"filter_annotation_instances",
# helpers
"add_annotation_bbox_to_json",
"add_annotation_comment_to_json",
Expand Down
Loading