Skip to content

Commit e6dd9e2

Browse files
authored
Merge pull request #522 from superannotateai/develop
Develop
2 parents 1e58550 + 8cc05d3 commit e6dd9e2

File tree

86 files changed

+5723
-5899
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+5723
-5899
lines changed

.readthedocs.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,3 @@ python:
2323
install:
2424
- requirements: requirements.txt
2525
- requirements: requirements_extra.txt
26-
- requirements: requirements_prod.txt

docs/source/superannotate.sdk.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ ________
3434
.. automethod:: superannotate.SAClient.upload_images_to_project
3535
.. automethod:: superannotate.SAClient.attach_items_from_integrated_storage
3636
.. automethod:: superannotate.SAClient.upload_image_to_project
37+
.. automethod:: superannotate.SAClient.upload_annotations
3738
.. automethod:: superannotate.SAClient.delete_annotations
3839
.. _ref_upload_images_from_folder_to_project:
3940
.. automethod:: superannotate.SAClient.upload_images_from_folder_to_project
@@ -94,6 +95,7 @@ Subsets
9495
______
9596

9697
.. automethod:: superannotate.SAClient.get_subsets
98+
.. automethod:: superannotate.SAClient.add_items_to_subset
9799

98100
----------
99101

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ plotly==4.1.0
1313
ffmpeg-python>=0.2.0
1414
fire==0.4.0
1515
mixpanel==4.8.3
16-
pydantic>=1.8.2
16+
pydantic>=1.10.2
1717
setuptools~=57.4.0
1818
aiohttp==3.8.1
1919
email-validator>=1.0.3

src/superannotate/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import os
22
import sys
33

4-
__version__ = "4.4.4"
4+
5+
__version__ = "4.4.5b
6+
57

68
sys.path.append(os.path.split(os.path.realpath(__file__))[0])
79

src/superannotate/lib/app/common.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,3 @@ def tqdm_converter(total_num, images_converted, images_not_converted, finish_eve
7171
else:
7272
pbar.update(total_num - pbar.n)
7373
break
74-
75-
76-
def get_annotation_json_name(image_name, project_type):
77-
if project_type == "Vector":
78-
return image_name + "___objects.json"
79-
else:
80-
return image_name + "___pixel.json"
81-
82-
83-
def get_annotation_png_name(image_name):
84-
return image_name + "___save.png"

src/superannotate/lib/app/exceptions.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,3 @@ class PathError(AppException):
55
"""
66
User input Error
77
"""
8-
9-
10-
class EmptyOutputError(AppException):
11-
"""
12-
Empty Output Error
13-
"""

src/superannotate/lib/app/helpers.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,17 @@
22
import uuid
33
from pathlib import Path
44
from typing import List
5-
from typing import Optional
65
from typing import Tuple
76
from typing import Union
87

98
import boto3
109
import pandas as pd
1110
from superannotate.lib.app.exceptions import AppException
12-
from superannotate.lib.app.exceptions import PathError
1311
from superannotate.lib.core import ATTACHED_VIDEO_ANNOTATION_POSTFIX
1412
from superannotate.lib.core import PIXEL_ANNOTATION_POSTFIX
1513
from superannotate.lib.core import VECTOR_ANNOTATION_POSTFIX
1614

1715

18-
def split_project_path(project_path: str) -> Tuple[str, Optional[str]]:
19-
path = Path(project_path)
20-
if len(path.parts) > 3:
21-
raise PathError("There can be no sub folders in the project")
22-
elif len(path.parts) == 2:
23-
project_name, folder_name = path.parts
24-
else:
25-
project_name, folder_name = path.name, ""
26-
27-
return project_name, folder_name
28-
29-
30-
def extract_project_folder(user_input: Union[str, dict]) -> Tuple[str, Optional[str]]:
31-
if isinstance(user_input, str):
32-
return split_project_path(user_input)
33-
elif isinstance(user_input, dict):
34-
project_path = user_input.get("name")
35-
if not project_path:
36-
raise PathError("Invalid project path")
37-
return split_project_path(user_input["name"])
38-
raise PathError("Invalid project path")
39-
40-
4116
def get_annotation_paths(folder_path, s3_bucket=None, recursive=False):
4217
annotation_paths = []
4318
if s3_bucket:

src/superannotate/lib/app/interface/base_interface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
from typing import Tuple
1010

1111
import lib.core as constants
12-
from lib.app.helpers import extract_project_folder
1312
from lib.app.interface.types import validate_arguments
1413
from lib.core import CONFIG
1514
from lib.core.exceptions import AppException
1615
from lib.infrastructure.controller import Controller
1716
from lib.infrastructure.repositories import ConfigRepository
17+
from lib.infrastructure.utils import extract_project_folder
1818
from mixpanel import Mixpanel
1919
from superannotate import __version__
2020

src/superannotate/lib/app/interface/cli_interface.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77
import lib.core as constances
88
from lib import __file__ as lib_path
9-
from lib.app.helpers import split_project_path
109
from lib.app.input_converters.conversion import import_annotation
1110
from lib.app.interface.sdk_interface import SAClient
1211
from lib.core.entities import ConfigEntity
1312
from lib.infrastructure.repositories import ConfigRepository
13+
from lib.infrastructure.utils import split_project_path
1414

1515

1616
class CLIFacade:
@@ -176,9 +176,7 @@ def _upload_annotations(
176176
):
177177
project_folder_name = project
178178
project_name, folder_name = split_project_path(project)
179-
project = (
180-
SAClient().controller.get_project_metadata(project_name=project_name).data
181-
)
179+
project = SAClient().controller.get_project(project_name)
182180
if not format:
183181
format = "SuperAnnotate"
184182
if not dataset_name and format == "COCO":

0 commit comments

Comments
 (0)