Skip to content

Commit d452cbd

Browse files
committed
Merge branch 'bug-fix' into re-design-sdk
2 parents 10440b0 + 098a51b commit d452cbd

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,6 +1073,12 @@ def get_image_metadata(project: Union[str, dict], image_name: str, *_, **__):
10731073
res_data["annotation_status"] = constances.AnnotationStatus.get_name(
10741074
res_data["annotation_status"]
10751075
)
1076+
res_data["prediction_status"] = constances.SegmentationStatus.get_name(
1077+
res_data["prediction_status"]
1078+
)
1079+
res_data["segmentation_status"] = constances.SegmentationStatus.get_name(
1080+
res_data["segmentation_status"]
1081+
)
10761082
return res_data
10771083

10781084

@@ -1101,6 +1107,7 @@ def set_images_annotation_statuses(
11011107
)
11021108
if response.errors:
11031109
raise AppValidationException(response.errors)
1110+
logger.info("Annotations status of images changed")
11041111

11051112

11061113
@Trackable
@@ -1143,13 +1150,9 @@ def assign_images(project: Union[str, dict], image_names: List[str], user: str):
11431150
project_name, folder_name = extract_project_folder(project)
11441151
if not folder_name:
11451152
folder_name = "root"
1146-
response = controller.assign_images(project_name, folder_name, image_names, user)
1147-
if response.errors:
1148-
raise AppValidationException(response.errors)
1149-
11501153
contributors = controller.get_project_metadata(
11511154
project_name=project_name, include_contributors=True
1152-
).data["contributors"]
1155+
).data["project"].users
11531156
contributor = None
11541157
for c in contributors:
11551158
if c["user_id"] == user:

src/superannotate/lib/core/usecases.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1754,9 +1754,10 @@ def execute(self):
17541754
user_id=self._user_id,
17551755
user_role=self.user_role,
17561756
)
1757-
logger.info(
1758-
f"Shared project {self._project_entity.name} with user {self._user_id} and role {self.user_role}"
1759-
)
1757+
if not self._response.errors:
1758+
logger.info(
1759+
f"Shared project {self._project_entity.name} with user {self._user_id} and role {self.user_role}"
1760+
)
17601761
return self._response
17611762

17621763

@@ -1938,7 +1939,7 @@ def work_flow_use_case(self):
19381939
)
19391940

19401941
def execute(self):
1941-
data = {"project": self._project}
1942+
data = {"project": self._projects.get_one(uuid=self._project.uuid,team_id=self._project.team_id) }
19421943

19431944
if self._include_annotation_classes:
19441945
self.annotation_classes_use_case.execute()
@@ -3908,6 +3909,7 @@ def execute(self):
39083909
model_name=self._ml_model_name,
39093910
image_ids=image_ids,
39103911
)
3912+
39113913
succeded_imgs = []
39123914
failed_imgs = []
39133915
while len(succeded_imgs) + len(failed_imgs) != len(image_ids):
@@ -3921,7 +3923,7 @@ def execute(self):
39213923
succeded_imgs = [
39223924
img["name"]
39233925
for img in images_metadata
3924-
if img["segmentation_status"] == 2
3926+
if img["segmentation_status"] == 3
39253927
]
39263928
failed_imgs = [
39273929
img["name"]
@@ -3931,7 +3933,7 @@ def execute(self):
39313933

39323934
complete_images = succeded_imgs + failed_imgs
39333935
logger.info(
3934-
f"prediction complete on {len(complete_images)} / {len(image_ids)} images"
3936+
f"segmentation complete on {len(complete_images)} / {len(image_ids)} images"
39353937
)
39363938
time.sleep(5)
39373939

@@ -4000,7 +4002,7 @@ def execute(self):
40004002
)
40014003

40024004
success_images = [
4003-
img["name"] for img in images_metadata if img["prediction_status"] == 2
4005+
img["name"] for img in images_metadata if img["prediction_status"] == 3
40044006
]
40054007
failed_images = [
40064008
img["name"] for img in images_metadata if img["prediction_status"] == 4

src/superannotate/lib/infrastructure/controller.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ def update_project(self, name: str, project_data: dict) -> Response:
208208
if entities and len(entities) == 1:
209209
project.name = project_data["name"]
210210
use_case = usecases.UpdateProjectUseCase(project, self.projects)
211-
use_case.execute()
212211
return use_case.execute()
213212
raise AppException("There are duplicated names.")
214213

0 commit comments

Comments
 (0)