superannotate 4.5.5.dev3__py3-none-any.whl → 4.5.6.dev1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
superannotate/__init__.py CHANGED
@@ -2,7 +2,7 @@ import logging
2
2
  import os
3
3
  import sys
4
4
 
5
- __version__ = "4.5.5dev3"
5
+ __version__ = "4.5.6dev1"
6
6
 
7
7
 
8
8
  os.environ.update({"sa_version": __version__})
@@ -96,8 +96,6 @@ PROJECT_TYPE = Literal[
96
96
  "Vector",
97
97
  "Video",
98
98
  "Document",
99
- "Tiled",
100
- "PointCloud",
101
99
  "Multimodal",
102
100
  ]
103
101
 
@@ -1409,7 +1407,7 @@ class SAClient(BaseInterfaceFacade, metaclass=TrackableMeta):
1409
1407
  :param project_description: The new project's description.
1410
1408
  :type project_description: str
1411
1409
 
1412
- :param project_type: The project type. Supported types: 'Vector', 'Video', 'Document', 'Tiled', 'PointCloud', 'Multimodal'.
1410
+ :param project_type: The project type. Supported types: 'Vector', 'Video', 'Document', 'Multimodal'.
1413
1411
  :type project_type: str
1414
1412
 
1415
1413
  :param settings: list of settings objects
@@ -184,6 +184,8 @@ PROJECT_SETTINGS_VALID_ATTRIBUTES = [
184
184
  "TemplateState",
185
185
  "CategorizeItems",
186
186
  "MaxIdleDuration",
187
+ "ItemAutoAssignOrder",
188
+ "ImageAutoAssignByCategory",
187
189
  ]
188
190
 
189
191
  __alL__ = (
@@ -9,7 +9,6 @@ import logging
9
9
  import os
10
10
  import platform
11
11
  import re
12
- import time
13
12
  import traceback
14
13
  from collections import defaultdict
15
14
  from collections.abc import Callable
@@ -47,6 +46,7 @@ from lib.core.usecases.base import BaseReportableUseCase
47
46
  from lib.core.usecases.folders import CreateFolderUseCase
48
47
  from lib.core.usecases.items import AttachItems
49
48
  from lib.core.utils import run_async
49
+ from lib.core.utils import set_last_action
50
50
  from lib.core.video_convertor import VideoFrameGenerator
51
51
  from lib.infrastructure.utils import divide_to_chunks
52
52
  from pydantic import BaseModel
@@ -876,12 +876,9 @@ class UploadAnnotationUseCase(BaseReportableUseCase):
876
876
  return use_case.execute().data
877
877
 
878
878
  @staticmethod
879
- def set_defaults(team_id, annotation_data: dict, project_type: int):
879
+ def set_defaults(user_email, annotation_data: dict, project_type: int):
880
880
  default_data = {}
881
- annotation_data["metadata"]["lastAction"] = {
882
- "email": team_id,
883
- "timestamp": int(round(time.time() * 1000)),
884
- }
881
+ set_last_action(annotation_data, user_email)
885
882
  instances = annotation_data.get("instances", [])
886
883
  if project_type in constants.ProjectType.images:
887
884
  default_data["probability"] = 100
@@ -1908,11 +1905,7 @@ class UploadMultiModalAnnotationsUseCase(BaseReportableUseCase):
1908
1905
  return self.list_items(folder, attached_item_names)
1909
1906
 
1910
1907
  def set_defaults(self, annotation: dict):
1911
- annotation["metadata"]["lastAction"] = {
1912
- "email": self._project.team_id,
1913
- "timestamp": int(round(time.time() * 1000)),
1914
- }
1915
- return annotation
1908
+ return set_last_action(annotation, self._user.email)
1916
1909
 
1917
1910
  @staticmethod
1918
1911
  def serialize_folder_name(val):
@@ -1,9 +1,19 @@
1
1
  import asyncio
2
2
  import re
3
+ import time
3
4
  import typing
4
5
  from threading import Thread
5
6
 
6
7
 
8
+ def set_last_action(annotation: dict, email: str) -> dict:
9
+ """Set ``metadata.lastAction`` on an annotation JSON in place."""
10
+ annotation.setdefault("metadata", {})["lastAction"] = {
11
+ "email": email,
12
+ "timestamp": int(round(time.time() * 1000)),
13
+ }
14
+ return annotation
15
+
16
+
7
17
  class AsyncThread(Thread):
8
18
  def __init__(
9
19
  self, group=None, target=None, name=None, args=(), kwargs=None, *, daemon=None
@@ -8,6 +8,7 @@ from lib.core.entities import BaseItemEntity
8
8
  from lib.core.entities import FolderEntity
9
9
  from lib.core.entities import ProjectEntity
10
10
  from lib.core.utils import run_async
11
+ from lib.core.utils import set_last_action
11
12
  from lib.infrastructure.controller import Controller
12
13
 
13
14
 
@@ -57,6 +58,10 @@ class BaseMultimodalAnnotationAdapter(ABC):
57
58
  return annotation.get("value")
58
59
  return None
59
60
 
61
+ def set_last_action(self):
62
+ """Stamp ``metadata.lastAction`` with the current user, called on save."""
63
+ set_last_action(self.annotation, self._controller.current_user.email)
64
+
60
65
  def set_component_value(self, component_id: str, value: Any):
61
66
  data = self.annotation.setdefault("data", {})
62
67
  component_data = data.get(component_id)
@@ -116,6 +121,7 @@ class MultimodalSmallAnnotationAdapter(BaseMultimodalAnnotationAdapter):
116
121
  return self._annotation
117
122
 
118
123
  def save(self):
124
+ self.set_last_action()
119
125
  self._controller.annotations.set_item_annotations(
120
126
  project=self._project,
121
127
  folder=self._folder,
@@ -142,6 +148,7 @@ class MultimodalLargeAnnotationAdapter(BaseMultimodalAnnotationAdapter):
142
148
  return self._annotation
143
149
 
144
150
  def save(self):
151
+ self.set_last_action()
145
152
  run_async(
146
153
  self._controller.service_provider.annotations.upload_big_annotation(
147
154
  project=self._project,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: superannotate
3
- Version: 4.5.5.dev3
3
+ Version: 4.5.6.dev1
4
4
  Summary: Python SDK to SuperAnnotate platform
5
5
  Home-page: https://github.com/superannotateai/superannotate-python-sdk
6
6
  Author: SuperAnnotate AI
@@ -1,4 +1,4 @@
1
- superannotate/__init__.py,sha256=TCgtpjfYBozj2in9IOibotN6cV6UvT1T-BnS8qdvKkk,2049
1
+ superannotate/__init__.py,sha256=9u8GGsDCgqlFAxrt0qmMXkrJQMTGP8lXC5yY1wWmj4w,2049
2
2
  superannotate/lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  superannotate/lib/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  superannotate/lib/app/common.py,sha256=JxHOUn3h3VJJdLnWwjV03TXvruY6-o3UkbOPcDdGDHs,2009
@@ -60,12 +60,12 @@ superannotate/lib/app/interface/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm
60
60
  superannotate/lib/app/interface/base_interface.py,sha256=u6_NSghd_zqWAsBnZCcVRL_SLrCjz8rJlTbeqZSlLjw,9208
61
61
  superannotate/lib/app/interface/cli_interface.py,sha256=TqjLJ82onoDju1wb1NzrWdltUZO0r_9sgj4FqIYATf4,9325
62
62
  superannotate/lib/app/interface/responses.py,sha256=khfeRw45DdSLT1_eQ6VoNHsDW4FE9_RbddX3fH_EV8s,2805
63
- superannotate/lib/app/interface/sdk_interface.py,sha256=aODZUOBZUPiHI8XxhBDEi7sPR7dY2lFGu-qR2hlGMBM,227859
63
+ superannotate/lib/app/interface/sdk_interface.py,sha256=KEkFCjFSjW-8ymnDhMEtQziP5yhA_B8mTpIqubqP2OE,227805
64
64
  superannotate/lib/app/interface/types.py,sha256=pPSUWMpveHbdly9MA3kR4bwNJWotpT32ncQsHV4LqKI,1084
65
65
  superannotate/lib/app/interface/sdk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
66
66
  superannotate/lib/app/interface/sdk/folders.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
67
67
  superannotate/lib/app/interface/sdk/project.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
68
- superannotate/lib/core/__init__.py,sha256=0Wq2-q_PP6d1rKBZhshD8sV4SZEQm0oqOBGy4fW5SpQ,7140
68
+ superannotate/lib/core/__init__.py,sha256=4wuQQOLPGS8_9UiPMYvQThSZGHFchhC3u6L6tEv0jx4,7200
69
69
  superannotate/lib/core/base_usecases.py,sha256=8OigtqqegEc-jjN_viWAnA2WuyuM7VA_jdLQEw2l9MI,964
70
70
  superannotate/lib/core/conditions.py,sha256=Z3dT23hzdpJfdWJs3VaOctKYShRCGZt8xDPrGgTthao,2703
71
71
  superannotate/lib/core/config.py,sha256=anan5UHwcWa9JF3yKAuJezh_OC5vzJUJlBAcORORPLA,1701
@@ -79,7 +79,7 @@ superannotate/lib/core/response.py,sha256=fXIvLPAQxt5VgNK7AQ_i0Gg0tEjxFNMa5VgisT
79
79
  superannotate/lib/core/service_types.py,sha256=xt2vtlaANNEyy89n_98ippq4eoSSJTngtTHCR6gELJU,6743
80
80
  superannotate/lib/core/serviceproviders.py,sha256=dQE1nFi8Tx_49ATHJteQO9m0JjabBZIvhW70gx1k7KM,28025
81
81
  superannotate/lib/core/types.py,sha256=QZqN17gTZ8urymmXptkeHWO3ALR2c1v6D4kwkjSB9TM,619
82
- superannotate/lib/core/utils.py,sha256=EwVlDBp3cxP-pw055eE2f4Ix6jFQ3yXl1-O4REu_Pnw,2955
82
+ superannotate/lib/core/utils.py,sha256=yyrrQwA9yr7MdhQ84_diDzwAlXQmhacQH6NXjb3Jk5U,3263
83
83
  superannotate/lib/core/video_convertor.py,sha256=w58deDMwUlcBFNSKhnzWiTc1tNaWvkEp7eb30Mm3t68,10094
84
84
  superannotate/lib/core/entities/__init__.py,sha256=CW0oWZUA2E0ohuc9M52tDIHKCMARG83dY0RMivau5_A,2288
85
85
  superannotate/lib/core/entities/base.py,sha256=cT3GCW3ZQ6zDfmO8X05kGHrUb_5f0U4ZhkcxRKw6bsM,3774
@@ -93,7 +93,7 @@ superannotate/lib/core/entities/project.py,sha256=pG6jo269N4QcyH7hjRC4cETG-36CQK
93
93
  superannotate/lib/core/entities/project_entities.py,sha256=MHyzH7EDUzE6cIzcllvIWCVn7_pRiJiL65vKa3U4sfg,730
94
94
  superannotate/lib/core/entities/work_managament.py,sha256=-O9ukAlStYNkDaqDYyqeHpSfoaghsyoW5ZQt6Kygk_4,8550
95
95
  superannotate/lib/core/usecases/__init__.py,sha256=c-Nr8yynwxMmW4nw5PxswGawLPblKebw7xEmZZ9Z6Sc,543
96
- superannotate/lib/core/usecases/annotations.py,sha256=F-nnGI6UegPDOdMkKGPoINdt6Pg8P8uFHb_xW4wZRwY,82328
96
+ superannotate/lib/core/usecases/annotations.py,sha256=Ws0QVpcM_wMICtNFh5OPub7n6tiHH3mQ-qSXu7vCc9g,82139
97
97
  superannotate/lib/core/usecases/base.py,sha256=1jsKO9kwT6ZALnMqG3r7NpWnRkLa5r3mXFREzeMNuLs,1846
98
98
  superannotate/lib/core/usecases/classes.py,sha256=TCq_Ukx4iTaq5VIaahkrsP9G3j2nrPiYioevsGnpVEo,7881
99
99
  superannotate/lib/core/usecases/custom_fields.py,sha256=e_EiEozVQ-ly49hnILWe7QX0AYp9G5qUc0WkTHLVOK8,5817
@@ -104,7 +104,7 @@ superannotate/lib/core/usecases/items.py,sha256=3Lf1wvMauvv9MN1ISeMJlFEruBeVXVyu
104
104
  superannotate/lib/core/usecases/models.py,sha256=DSZli2Iv16uwT8R4nzFd9OrXK86AtOYruJL6SZBWFts,17519
105
105
  superannotate/lib/core/usecases/projects.py,sha256=uryxsQs4jPET04UiGYWWdZuuKKIo_3NXBDaNPwtLi18,41585
106
106
  superannotate/lib/infrastructure/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
107
- superannotate/lib/infrastructure/annotation_adapter.py,sha256=gnk-6zK3dj_uxTs2DMIsEg03exTdFWToSrzHXwGt8FA,5119
107
+ superannotate/lib/infrastructure/annotation_adapter.py,sha256=nv_zqWN1S6jwn1miJQ8bypF6OK9GQRN4Fn6hMS5JOag,5417
108
108
  superannotate/lib/infrastructure/controller.py,sha256=x_6m34FMrdiXa3JSjvW1orbiktJzZicKVLnBTwJnTTY,77308
109
109
  superannotate/lib/infrastructure/custom_entities.py,sha256=sIOIts5d3WClCPYNfMuWN_3rU83HwXTMDhMQNzNwHnc,1505
110
110
  superannotate/lib/infrastructure/helpers.py,sha256=0mKJSkQM-BOfk_fE86V5M3qoxKqBeTY9al0-vnE4ROE,739
@@ -126,9 +126,9 @@ superannotate/lib/infrastructure/services/item_service.py,sha256=AWlF5duAIMT4M8v
126
126
  superannotate/lib/infrastructure/services/project.py,sha256=-QPkjB_idTmuAILm0gDMJr4PnGnVxKZzqDBD9C_EppM,6819
127
127
  superannotate/lib/infrastructure/services/telemetry_scoring.py,sha256=AUfPuGqIemj6B6pr-zL_fUdJ7t0F35ZaicoACZ38Fzc,1661
128
128
  superannotate/lib/infrastructure/services/work_management.py,sha256=zBfBmwdpABu2aZzFgSt7QlHqbxaEWLE69M7qnkT2By8,21705
129
- superannotate-4.5.5.dev3.dist-info/LICENSE,sha256=MftFTxl8DpSgrE93IB7FmL3U4tyDFCfA1gMPh0IJoM4,1073
130
- superannotate-4.5.5.dev3.dist-info/METADATA,sha256=nqwF2RAaP9FPwb53lNWc4T_8RVQJZzMceo5w_HOC4dw,5856
131
- superannotate-4.5.5.dev3.dist-info/WHEEL,sha256=BNRMDyzLkkcmlv0J8ppDQkk2VED33SesJDynr9ED1gc,91
132
- superannotate-4.5.5.dev3.dist-info/entry_points.txt,sha256=UaGfiSVUZXDebO155xqw3HqapAwWx-_-pAGnjQQSFJo,82
133
- superannotate-4.5.5.dev3.dist-info/top_level.txt,sha256=lU8ukGQN-10ur9-ByDVyxgzp9g_yiiGYrXX5m5BbrF8,14
134
- superannotate-4.5.5.dev3.dist-info/RECORD,,
129
+ superannotate-4.5.6.dev1.dist-info/LICENSE,sha256=MftFTxl8DpSgrE93IB7FmL3U4tyDFCfA1gMPh0IJoM4,1073
130
+ superannotate-4.5.6.dev1.dist-info/METADATA,sha256=udbHj0O-vOt-3PD_72Hg5aav5NSWi-m4fn9ahxhLEpc,5856
131
+ superannotate-4.5.6.dev1.dist-info/WHEEL,sha256=BNRMDyzLkkcmlv0J8ppDQkk2VED33SesJDynr9ED1gc,91
132
+ superannotate-4.5.6.dev1.dist-info/entry_points.txt,sha256=UaGfiSVUZXDebO155xqw3HqapAwWx-_-pAGnjQQSFJo,82
133
+ superannotate-4.5.6.dev1.dist-info/top_level.txt,sha256=lU8ukGQN-10ur9-ByDVyxgzp9g_yiiGYrXX5m5BbrF8,14
134
+ superannotate-4.5.6.dev1.dist-info/RECORD,,