Skip to content

Commit ffac18a

Browse files
Vaghinak BasentsyanVaghinak Basentsyan
authored andcommitted
Added type AnnotationStatuses
1 parent 3bd03e4 commit ffac18a

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

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

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
from lib.app.interface.types import AnnotationType
3131
from lib.app.interface.types import ImageQualityChoices
3232
from lib.app.interface.types import NotEmptyStr
33-
from lib.app.interface.types import Status
3433
from lib.app.interface.types import validate_arguments
3534
from lib.app.mixp.decorators import Trackable
3635
from lib.app.serializers import BaseSerializers
@@ -280,7 +279,7 @@ def clone_project(
280279
def search_images(
281280
project: Union[NotEmptyStr, dict],
282281
image_name_prefix: Optional[NotEmptyStr] = None,
283-
annotation_status: Optional[Status] = None,
282+
annotation_status: Optional[AnnotationStatuses] = None,
284283
return_metadata: Optional[StrictBool] = False,
285284
):
286285
"""Search images by name_prefix (case-insensitive) and annotation status
@@ -603,7 +602,7 @@ def upload_images_from_public_urls_to_project(
603602
project: Union[NotEmptyStr, dict],
604603
img_urls: List[NotEmptyStr],
605604
img_names: Optional[List[NotEmptyStr]] = None,
606-
annotation_status: Optional[Status] = "NotStarted",
605+
annotation_status: Optional[AnnotationStatuses] = "NotStarted",
607606
image_quality_in_editor: Optional[NotEmptyStr] = None,
608607
):
609608
"""Uploads all images given in the list of URL strings in img_urls to the project.
@@ -1641,7 +1640,7 @@ def upload_videos_from_folder_to_project(
16411640
target_fps: Optional[int] = None,
16421641
start_time: Optional[float] = 0.0,
16431642
end_time: Optional[float] = None,
1644-
annotation_status: Optional[Status] = "NotStarted",
1643+
annotation_status: Optional[AnnotationStatuses] = "NotStarted",
16451644
image_quality_in_editor: Optional[str] = None,
16461645
):
16471646
"""Uploads image frames from all videos with given extensions from folder_path to the project.
@@ -1778,7 +1777,7 @@ def upload_video_to_project(
17781777
target_fps: Optional[int] = None,
17791778
start_time: Optional[float] = 0.0,
17801779
end_time: Optional[float] = None,
1781-
annotation_status: Optional[Status] = "NotStarted",
1780+
annotation_status: Optional[AnnotationStatuses] = "NotStarted",
17821781
image_quality_in_editor: Optional[NotEmptyStr] = None,
17831782
):
17841783
"""Uploads image frames from video to platform. Uploaded images will have
@@ -2235,7 +2234,7 @@ def download_image(
22352234
def attach_image_urls_to_project(
22362235
project: Union[NotEmptyStr, dict],
22372236
attachments: Union[str, Path],
2238-
annotation_status: Optional[Status] = "NotStarted",
2237+
annotation_status: Optional[AnnotationStatuses] = "NotStarted",
22392238
):
22402239
"""Link images on external storage to SuperAnnotate.
22412240
@@ -2298,7 +2297,7 @@ def attach_image_urls_to_project(
22982297
def attach_video_urls_to_project(
22992298
project: Union[NotEmptyStr, dict],
23002299
attachments: Union[str, Path],
2301-
annotation_status: Optional[Status] = "NotStarted",
2300+
annotation_status: Optional[AnnotationStatuses] = "NotStarted",
23022301
):
23032302
"""Link videos on external storage to SuperAnnotate.
23042303
@@ -3314,7 +3313,7 @@ def upload_image_to_project(
33143313
project: NotEmptyStr,
33153314
img,
33163315
image_name: Optional[NotEmptyStr] = None,
3317-
annotation_status: Optional[Status] = "NotStarted",
3316+
annotation_status: Optional[AnnotationStatuses] = "NotStarted",
33183317
from_s3_bucket=None,
33193318
image_quality_in_editor: Optional[NotEmptyStr] = None,
33203319
):
@@ -3389,7 +3388,7 @@ def search_models(
33893388
def upload_images_to_project(
33903389
project: NotEmptyStr,
33913390
img_paths: List[NotEmptyStr],
3392-
annotation_status: Optional[Status] = "NotStarted",
3391+
annotation_status: Optional[AnnotationStatuses] = "NotStarted",
33933392
from_s3_bucket=None,
33943393
image_quality_in_editor: Optional[ImageQualityChoices] = None,
33953394
):
@@ -3523,7 +3522,7 @@ def delete_annotations(
35233522
def attach_document_urls_to_project(
35243523
project: Union[NotEmptyStr, dict],
35253524
attachments: Union[Path, NotEmptyStr],
3526-
annotation_status: Optional[Status] = "NotStarted",
3525+
annotation_status: Optional[AnnotationStatuses] = "NotStarted",
35273526
):
35283527
"""Link documents on external storage to SuperAnnotate.
35293528

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def validate(cls, value: Union[str]) -> Union[str]:
1717
if cls.curtail_length and len(value) > cls.curtail_length:
1818
value = value[: cls.curtail_length]
1919
if value.lower() not in AnnotationStatus.values():
20-
raise TypeError(f"Available statuses is {', '.join(AnnotationStatus)}. ")
20+
raise TypeError(f"Available statuses is {', '.join(AnnotationStatus.titles())}. ")
2121
return value
2222

2323

0 commit comments

Comments
 (0)