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
2 changes: 0 additions & 2 deletions requirements_dev.txt

This file was deleted.

1 change: 0 additions & 1 deletion requirements_prod.txt

This file was deleted.

8 changes: 0 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,16 @@ def get_version():

sdk_version = get_version()


requirements_path = "requirements_{}.txt".format('dev' if 'dev' in sdk_version else 'prod')

requirements = []

with open("requirements.txt") as f:
requirements.extend(f.read().splitlines())

with open(requirements_path) as f:
requirements.extend(f.read().splitlines())


with open('README.md') as f:
readme = f.read()

readme = "\n".join(readme.split('\n')[2:])


setup(
name='superannotate',
version=sdk_version,
Expand Down
8 changes: 1 addition & 7 deletions src/superannotate/lib/core/entities/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,7 @@
from lib.core.entities.project_entities import TeamEntity
from lib.core.entities.project_entities import UserEntity
from lib.core.entities.project_entities import WorkflowEntity
from superannotate_schemas.schemas.internal.document import DocumentAnnotation
from superannotate_schemas.schemas.internal.pixel import PixelAnnotation
from superannotate_schemas.schemas.internal.vector import VectorAnnotation
from superannotate_schemas.schemas.internal.video import VideoAnnotation
from superannotate_schemas.schemas.internal.video import (
VideoAnnotation as VideoExportAnnotation,
)


# from lib.core.entities.project_entities import ProjectEntity

Expand Down
9 changes: 0 additions & 9 deletions src/superannotate/lib/core/entities/project_entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,7 @@
from typing import List
from typing import Union

from lib.core.enums import ClassTypeEnum
from lib.core.enums import SegmentationStatus
from superannotate_schemas.schemas.classes import AnnotationClass


class AnnotationClassEntity(AnnotationClass):
def deserialize(self):
data = self.dict()
data["type"] = ClassTypeEnum.get_value(data["type"])
return data


class BaseEntity(ABC):
Expand Down
11 changes: 0 additions & 11 deletions src/superannotate/lib/core/reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ def disable_warnings(self):
def disable_info(self):
self._log_info = False

def enable_warnings(self):
self._log_warning = True

def enable_info(self):
self._log_info = True

Expand Down Expand Up @@ -127,14 +124,6 @@ def update_progress(self, value: int = 1):
if self.progress_bar:
self.progress_bar.update(value)

def generate_report(self) -> str:
report = ""
if self.info_messages:
report += "\n".join(self.info_messages)
if self.warning_messages:
report += "\n".join(self.warning_messages)
return report

def store_message(self, key: str, value: str):
self.custom_messages[key].add(value)

Expand Down
4 changes: 0 additions & 4 deletions src/superannotate/lib/core/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ def report(self):
def report(self, value: str):
self._report.append(value)

@property
def report_messages(self):
return self._report

@property
def status(self):
return self._status
Expand Down
5 changes: 0 additions & 5 deletions src/superannotate/lib/core/serviceproviders.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,6 @@ def set_project_workflow_attributes_bulk(
):
raise NotImplementedError

def get_pre_annotation_upload_data(
self, project_id: int, team_id: int, image_ids: List[int], folder_id: int
):
raise NotImplementedError

def get_annotation_upload_data(
self, project_id: int, team_id: int, image_ids: List[int], folder_id: int
) -> ServiceResponse:
Expand Down
113 changes: 0 additions & 113 deletions src/superannotate/lib/core/usecases/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,55 +50,6 @@
logger = get_default_logger()


class GetImagesUseCase(BaseUseCase):
def __init__(
self,
project: ProjectEntity,
folder: FolderEntity,
images: BaseReadOnlyRepository,
annotation_status: str = None,
image_name_prefix: str = None,
):
super().__init__()
self._project = project
self._folder = folder
self._images = images
self._annotation_status = annotation_status
self._image_name_prefix = image_name_prefix

def validate_project_type(self):
if self._project.type in constances.LIMITED_FUNCTIONS:
raise AppValidationException(
constances.LIMITED_FUNCTIONS[self._project.type]
)

def validate_annotation_status(self):
if (
self._annotation_status
and self._annotation_status.lower()
not in constances.AnnotationStatus.values()
):
raise AppValidationException("Invalid annotations status.")

def execute(self):
if self.is_valid():
condition = (
Condition("team_id", self._project.team_id, EQ)
& Condition("project_id", self._project.id, EQ)
& Condition("folder_id", self._folder.uuid, EQ)
)
if self._image_name_prefix:
condition = condition & Condition("name", self._image_name_prefix, EQ)
if self._annotation_status:
condition = condition & Condition(
"annotation_status",
constances.AnnotationStatus.get_value(self._annotation_status),
EQ,
)
self._response.data = self._images.get_all(condition)
return self._response


class GetImageUseCase(BaseUseCase):
def __init__(
self,
Expand Down Expand Up @@ -134,41 +85,6 @@ def execute(self):
return self._response


class GetAllImagesUseCase(BaseUseCase):
def __init__(
self,
project: ProjectEntity,
service_provider: SuperannotateServiceProvider,
annotation_status: str = None,
name_prefix: str = None,
):
super().__init__()
self._project = project
self._service_provider = service_provider
self._annotation_status = annotation_status
self._name_prefix = name_prefix

@property
def annotation_status(self):
return constances.AnnotationStatus.get_value(self._annotation_status)

def execute(self):
condition = (
Condition("team_id", self._project.team_id, EQ)
& Condition("project_id", self._project.id, EQ)
& Condition("folder_id", 0, EQ)
)
if self._annotation_status:
condition &= Condition("annotation_status", self.annotation_status, EQ)
if self._name_prefix:
condition &= Condition("name", self._name_prefix, EQ)
images_list = self._service_provider.list_images(
query_string=condition.build_query()
)
self._response.data = [ImageEntity.from_dict(**image) for image in images_list]
return self._response


class GetBulkImages(BaseUseCase):
def __init__(
self,
Expand Down Expand Up @@ -1963,35 +1879,6 @@ def execute(self):
self._annotation_classes_repo.delete(uuid=self.uuid)


class GetAnnotationClassUseCase(BaseUseCase):
def __init__(
self,
annotation_classes_repo: BaseManageableRepository,
annotation_class_name: str,
):
super().__init__()
self._annotation_classes_repo = annotation_classes_repo
self._annotation_class_name = annotation_class_name

def execute(self):
classes = self._annotation_classes_repo.get_all(
condition=Condition("name", self._annotation_class_name, EQ)
)
self._response.data = classes[0]
return self._response


class UploadFileToS3UseCase(BaseUseCase):
def __init__(self, to_s3_bucket, path, s3_key: str):
super().__init__()
self._to_s3_bucket = to_s3_bucket
self._path = path
self._s3_key = s3_key

def execute(self):
self._to_s3_bucket.upload_file(str(self._path), self._s3_key)


class ExtractFramesUseCase(BaseInteractiveUseCase):
def __init__(
self,
Expand Down
56 changes: 0 additions & 56 deletions src/superannotate/lib/core/validators.py

This file was deleted.

Loading