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
11 changes: 0 additions & 11 deletions src/superannotate/lib/app/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,3 @@ def tqdm_converter(total_num, images_converted, images_not_converted, finish_eve
else:
pbar.update(total_num - pbar.n)
break


def get_annotation_json_name(image_name, project_type):
if project_type == "Vector":
return image_name + "___objects.json"
else:
return image_name + "___pixel.json"


def get_annotation_png_name(image_name):
return image_name + "___save.png"
6 changes: 0 additions & 6 deletions src/superannotate/lib/app/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,3 @@ class PathError(AppException):
"""
User input Error
"""


class EmptyOutputError(AppException):
"""
Empty Output Error
"""
25 changes: 0 additions & 25 deletions src/superannotate/lib/app/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,17 @@
import uuid
from pathlib import Path
from typing import List
from typing import Optional
from typing import Tuple
from typing import Union

import boto3
import pandas as pd
from superannotate.lib.app.exceptions import AppException
from superannotate.lib.app.exceptions import PathError
from superannotate.lib.core import ATTACHED_VIDEO_ANNOTATION_POSTFIX
from superannotate.lib.core import PIXEL_ANNOTATION_POSTFIX
from superannotate.lib.core import VECTOR_ANNOTATION_POSTFIX


def split_project_path(project_path: str) -> Tuple[str, Optional[str]]:
path = Path(project_path)
if len(path.parts) > 3:
raise PathError("There can be no sub folders in the project")
elif len(path.parts) == 2:
project_name, folder_name = path.parts
else:
project_name, folder_name = path.name, ""

return project_name, folder_name


def extract_project_folder(user_input: Union[str, dict]) -> Tuple[str, Optional[str]]:
if isinstance(user_input, str):
return split_project_path(user_input)
elif isinstance(user_input, dict):
project_path = user_input.get("name")
if not project_path:
raise PathError("Invalid project path")
return split_project_path(user_input["name"])
raise PathError("Invalid project path")


def get_annotation_paths(folder_path, s3_bucket=None, recursive=False):
annotation_paths = []
if s3_bucket:
Expand Down
2 changes: 1 addition & 1 deletion src/superannotate/lib/app/interface/base_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
from typing import Tuple

import lib.core as constants
from lib.app.helpers import extract_project_folder
from lib.app.interface.types import validate_arguments
from lib.core import CONFIG
from lib.core.exceptions import AppException
from lib.infrastructure.controller import Controller
from lib.infrastructure.repositories import ConfigRepository
from lib.infrastructure.utils import extract_project_folder
from mixpanel import Mixpanel
from superannotate import __version__

Expand Down
2 changes: 1 addition & 1 deletion src/superannotate/lib/app/interface/cli_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

import lib.core as constances
from lib import __file__ as lib_path
from lib.app.helpers import split_project_path
from lib.app.input_converters.conversion import import_annotation
from lib.app.interface.sdk_interface import SAClient
from lib.core.entities import ConfigEntity
from lib.infrastructure.repositories import ConfigRepository
from lib.infrastructure.utils import split_project_path


class CLIFacade:
Expand Down
Loading