Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
3cabbfb
Added query function.
VaghinakDev Mar 22, 2022
739a1c9
Merge pull request #423 from superannotateai/friday_580
VaghinakDev Mar 23, 2022
0faffd5
Added search/get items
VaghinakDev Mar 24, 2022
5d77c1f
Merge pull request #424 from superannotateai/friday_search_items
VaghinakDev Mar 24, 2022
904f06e
Update version.py
VaghinakDev Mar 24, 2022
3a9bc1b
Update version.py
VaghinakDev Mar 24, 2022
fb57ea9
Added search/get items
VaghinakDev Mar 24, 2022
ddbb6f6
Minor changes
VaghinakDev Mar 25, 2022
49054fb
Merge branch 'friday' into friday_search_items
VaghinakDev Mar 25, 2022
19f3086
merge fix
VaghinakDev Mar 25, 2022
402d1bc
Changed integrations serualization
VaghinakDev Mar 25, 2022
31de2ec
Merge pull request #425 from superannotateai/friday_search_items
VaghinakDev Mar 25, 2022
fd4945d
Update version.py
VaghinakDev Mar 25, 2022
53adb73
Code fix
VaghinakDev Mar 28, 2022
207150e
Merge pull request #426 from superannotateai/friday_search_items
VaghinakDev Mar 28, 2022
f55a007
Update version.py
VaghinakDev Mar 28, 2022
9734c1b
Update pre_release.yml
VaghinakDev Mar 28, 2022
e5f06c6
Update release.yml
VaghinakDev Mar 28, 2022
e49ae59
Update checks_and_dev_deploy.yml
VaghinakDev Mar 28, 2022
f650a60
Delete build.yml
VaghinakDev Mar 28, 2022
959d723
Integrations fix
VaghinakDev Mar 28, 2022
9b6d979
fix mixpanel
VaghinakDev Mar 28, 2022
55d9f52
Udpated tests, fixed issues
VaghinakDev Mar 31, 2022
3b03b74
Changed schemas version
VaghinakDev Mar 31, 2022
7ff5f31
Update version.py
VaghinakDev Mar 31, 2022
49bf690
Cahgned items serialization.
VaghinakDev Apr 4, 2022
e625f2f
Change dev version to dev5
VaghinakDev Apr 4, 2022
096c869
Added instructions_link handeling
VaghinakDev Apr 4, 2022
586c9d2
Change version
VaghinakDev Apr 6, 2022
4801ecf
Merge branch 'develop' into friday
VaghinakDev Apr 6, 2022
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
20 changes: 0 additions & 20 deletions .github/workflows/build.yml

This file was deleted.

22 changes: 1 addition & 21 deletions .github/workflows/checks_and_dev_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,4 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Build and push to Docker Hub
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
file: Dockerfile_dev_env
tags: superannotate/pythonsdk-dev-env:latest


21 changes: 1 addition & 20 deletions .github/workflows/pre_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,4 @@ jobs:
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.pypi_password }}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Build and push to Docker Hub
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: superannotate/pythonsdk:dev
build-args: PIP_FLAGS=--pre

20 changes: 1 addition & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,4 @@ jobs:
with:
password: ${{ secrets.pypi_password }}
verbose: true
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Build and push to Docker Hub
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: superannotate/pythonsdk:latest

53 changes: 49 additions & 4 deletions docs/source/superannotate.sdk.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ ________
.. autofunction:: superannotate.delete_folders
.. autofunction:: superannotate.upload_images_to_project
.. autofunction:: superannotate.attach_image_urls_to_project
.. autofunction:: superannotate.upload_images_from_public_urls_to_project
.. autofunction:: superannotate.attach_document_urls_to_project
.. autofunction:: superannotate.attach_items_from_integrated_storage
.. autofunction:: superannotate.upload_image_to_project
Expand Down Expand Up @@ -70,6 +69,15 @@ _______

----------

Items
______

.. autofunction:: superannotate.query
.. autofunction:: superannotate.search_items
.. autofunction:: superannotate.get_item_metadata

----------

Images
______

Expand All @@ -81,7 +89,6 @@ ______
.. autofunction:: superannotate.download_image
.. autofunction:: superannotate.set_image_annotation_status
.. autofunction:: superannotate.set_images_annotation_statuses
.. autofunction:: superannotate.get_image_annotations
.. autofunction:: superannotate.download_image_annotations
.. autofunction:: superannotate.upload_image_annotations
.. autofunction:: superannotate.copy_image
Expand Down Expand Up @@ -175,6 +182,44 @@ Export metadata example:
}


----------

Integration metadata
_______________

Integration metadata example:

.. code-block:: python

{
"name": "My S3 Bucket",
"type": "aws",
"root": "test-openseadragon-1212"
}


----------

Item metadata
_______________

Item metadata example:

.. code-block:: python

{
"name": "example.jpeg",
"path": "project/folder_1/meow.jpeg",
"url": "https://sa-public-files.s3.../text_file_example_1.jpeg",
"annotation_status": "NotStarted",
"annotator_name": None,
"qa_name": None,
"entropy_value": None,
"createdAt": "2022-02-15T20:46:44.000Z",
"updatedAt": "2022-02-15T20:46:44.000Z"
}


----------

Image metadata
Expand All @@ -188,8 +233,8 @@ Image metadata example:
{
"name": "000000000001.jpg",
"annotation_status": "Completed",
"prediction_status": 1,
"segmentation_status": 1,
"prediction_status": "NotStarted",
"segmentation_status": "NotStarted",
"annotator_id": None,
"annotator_name": None,
"qa_id": None,
Expand Down
2 changes: 1 addition & 1 deletion requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
superannotate_schemas>=1.0.40b3
superannotate_schemas>=1.0.41dev1
23 changes: 12 additions & 11 deletions src/superannotate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
attach_document_urls_to_project,
)
from superannotate.lib.app.interface.sdk_interface import attach_image_urls_to_project
from superannotate.lib.app.interface.sdk_interface import attach_items_from_integrated_storage
from superannotate.lib.app.interface.sdk_interface import (
attach_items_from_integrated_storage,
)
from superannotate.lib.app.interface.sdk_interface import attach_video_urls_to_project
from superannotate.lib.app.interface.sdk_interface import benchmark
from superannotate.lib.app.interface.sdk_interface import clone_project
Expand Down Expand Up @@ -55,9 +57,9 @@
from superannotate.lib.app.interface.sdk_interface import get_annotations_per_frame
from superannotate.lib.app.interface.sdk_interface import get_exports
from superannotate.lib.app.interface.sdk_interface import get_folder_metadata
from superannotate.lib.app.interface.sdk_interface import get_image_annotations
from superannotate.lib.app.interface.sdk_interface import get_image_metadata
from superannotate.lib.app.interface.sdk_interface import get_integrations
from superannotate.lib.app.interface.sdk_interface import get_item_metadata
from superannotate.lib.app.interface.sdk_interface import (
get_project_and_folder_metadata,
)
Expand All @@ -71,12 +73,14 @@
from superannotate.lib.app.interface.sdk_interface import move_images
from superannotate.lib.app.interface.sdk_interface import pin_image
from superannotate.lib.app.interface.sdk_interface import prepare_export
from superannotate.lib.app.interface.sdk_interface import query
from superannotate.lib.app.interface.sdk_interface import rename_project
from superannotate.lib.app.interface.sdk_interface import run_prediction
from superannotate.lib.app.interface.sdk_interface import search_annotation_classes
from superannotate.lib.app.interface.sdk_interface import search_folders
from superannotate.lib.app.interface.sdk_interface import search_images
from superannotate.lib.app.interface.sdk_interface import search_images_all_folders
from superannotate.lib.app.interface.sdk_interface import search_items
from superannotate.lib.app.interface.sdk_interface import search_models
from superannotate.lib.app.interface.sdk_interface import search_projects
from superannotate.lib.app.interface.sdk_interface import search_team_contributors
Expand All @@ -98,16 +102,11 @@
from superannotate.lib.app.interface.sdk_interface import (
upload_images_from_folder_to_project,
)
from superannotate.lib.app.interface.sdk_interface import (
upload_images_from_public_urls_to_project,
)
from superannotate.lib.app.interface.sdk_interface import upload_images_to_project
from superannotate.lib.app.interface.sdk_interface import (
upload_preannotations_from_folder_to_project,
)
from superannotate.lib.app.interface.sdk_interface import (
upload_priority_scores,
)
from superannotate.lib.app.interface.sdk_interface import upload_priority_scores
from superannotate.lib.app.interface.sdk_interface import upload_video_to_project
from superannotate.lib.app.interface.sdk_interface import (
upload_videos_from_folder_to_project,
Expand Down Expand Up @@ -159,6 +158,7 @@
"clone_project",
"share_project",
"delete_project",
"rename_project",
"upload_priority_scores",
# Images Section
"search_images",
Expand All @@ -171,6 +171,10 @@
"search_folders",
"assign_folder",
"unassign_folder",
# Items Section
"get_item_metadata",
"search_items",
"query",
# Image Section
"copy_images",
"move_images",
Expand All @@ -186,7 +190,6 @@
"delete_annotations",
"upload_image_to_project",
"upload_image_annotations",
"upload_images_from_public_urls_to_project",
"upload_images_from_folder_to_project",
"attach_image_urls_to_project",
"attach_video_urls_to_project",
Expand All @@ -202,7 +205,6 @@
"add_annotation_bbox_to_image",
"add_annotation_point_to_image",
"add_annotation_comment_to_image",
"get_image_annotations",
"search_annotation_classes",
"create_annotation_classes_from_classes_json",
"upload_annotations_from_folder_to_project",
Expand All @@ -212,7 +214,6 @@
"run_prediction",
"search_models",
"download_model",
"rename_project",
"set_image_annotation_status",
"benchmark",
"consensus",
Expand Down
1 change: 1 addition & 0 deletions src/superannotate/lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@

def get_default_controller():
from lib.infrastructure.controller import Controller

return Controller.get_default()
2 changes: 1 addition & 1 deletion src/superannotate/lib/app/analytics/aggregators.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def aggregate_video_annotations_as_df(self, annotation_paths: List[str]):
raw_data.videoStatus = annotation_data["metadata"].get("status")
raw_data.videoUrl = annotation_data["metadata"].get("url")
raw_data.videoDuration = annotation_data["metadata"].get("duration")
# todo check

raw_data.videoError = annotation_data["metadata"].get("error")
raw_data.videoAnnotator = annotation_data["metadata"].get("annotatorEmail")
raw_data.videoQA = annotation_data["metadata"].get("qaEmail")
Expand Down
9 changes: 8 additions & 1 deletion src/superannotate/lib/app/annotation_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,18 @@ def add_annotation_comment_to_json(
):
"""Add a comment to SuperAnnotate format annotation JSON


:param annotation_json: annotations in SuperAnnotate format JSON or filepath to JSON
:type annotation_json: dict or Pathlike (str or Path)

:param comment_text: comment text
:type comment_text: str

:param comment_coords: [x, y] coords
:type comment_coords: list

:param comment_author: comment author email
:type comment_author: str

:param resolved: comment resolve status
:type resolved: bool
"""
Expand Down Expand Up @@ -106,12 +109,16 @@ def add_annotation_bbox_to_json(

:param annotation_json: annotations in SuperAnnotate format JSON or filepath to JSON
:type annotation_json: dict or Pathlike (str or Path)

:param bbox: 4 element list of top-left x,y and bottom-right x, y coordinates
:type bbox: list of floats

:param annotation_class_name: annotation class name
:type annotation_class_name: str

:param annotation_class_attributes: list of annotation class attributes
:type annotation_class_attributes: list of 2 element dicts

:param error: if not None, marks annotation as error (True) or no-error (False)
:type error: bool
"""
Expand Down
7 changes: 5 additions & 2 deletions src/superannotate/lib/app/interface/cli_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
from lib.infrastructure.repositories import ConfigRepository



class CLIFacade(BaseInterfaceFacade):
"""
With SuperAnnotate CLI, basic tasks can be accomplished using shell commands:
Expand Down Expand Up @@ -186,7 +185,11 @@ def _upload_annotations(
):
project_folder_name = project
project_name, folder_name = split_project_path(project)
project = Controller.get_default().get_project_metadata(project_name=project_name).data
project = (
Controller.get_default()
.get_project_metadata(project_name=project_name)
.data
)
if not format:
format = "SuperAnnotate"
if not dataset_name and format == "COCO":
Expand Down
Loading