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: 1 addition & 1 deletion src/superannotate/lib/app/analytics/aggregators.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import copy
import json
from dataclasses import dataclass
from pathlib import Path
from typing import List
from typing import Optional
from typing import Union

import lib.core as constances
import pandas as pd
from dataclasses import dataclass
from lib.app.exceptions import AppException
from lib.core import ATTACHED_VIDEO_ANNOTATION_POSTFIX
from lib.core import PIXEL_ANNOTATION_POSTFIX
Expand Down
13 changes: 11 additions & 2 deletions src/superannotate/lib/core/usecases/annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ def annotations_to_upload(self):
self._annotations_to_upload = annotations_to_upload
return self._annotations_to_upload

@property
def missing_annotations(self):
if not self._missing_annotations:
self._missing_annotations = []
return self._missing_annotations

def get_annotation_upload_data(
self, image_ids: List[int]
) -> UploadAnnotationAuthData:
Expand Down Expand Up @@ -223,7 +229,10 @@ def _log_report(self):
logger.warning(template.format("', '".join(values)))
if self.reporter.custom_messages.get("invalid_jsons"):
logger.warning(
f"Couldn't validate {len(self.reporter.custom_messages['invalid_jsons'])}/{len(self._annotations_to_upload + self._missing_annotations)} annotations from {self._folder_path}."
f"Couldn't validate {len(self.reporter.custom_messages['invalid_jsons'])}/"
f"{len(self.annotations_to_upload + self.missing_annotations)} annotations from {self._folder_path}. "
f"Use the validate_annotations function to discover the possible reason(s) for "
f"which an annotation is invalid."
)

def execute(self):
Expand Down Expand Up @@ -281,7 +290,7 @@ def execute(self):
self._response.data = (
uploaded_annotations,
failed_annotations,
[annotation.path for annotation in self._missing_annotations],
[annotation.path for annotation in self.missing_annotations],
)
return self._response

Expand Down
2 changes: 1 addition & 1 deletion src/superannotate/lib/core/usecases/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ def execute(self):
if invited:
self.reporter.log_info(
f"Sent team {'admin' if self._set_admin else 'contributor'} invitations"
f" to {len(to_add)}/{len(self._emails)} users."
f" to {len(invited)}/{len(self._emails)} users."
)
if failed:
to_skip = set(to_skip)
Expand Down
1 change: 0 additions & 1 deletion src/superannotate/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
__version__ = "4.2.9b1"

Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def test_document_annotation_upload_invalid_json(self):
self.assertEqual(len(failed_annotations), 1)
self.assertEqual(len(missing_annotations), 0)
self.assertIn("Couldn't validate 1/1 annotations", self._caplog.text)
self.assertIn("Use the validate_annotations function to discover the possible reason(s) for which an annotation is invalid.", self._caplog.text)

def test_text_annotation_upload(self):
sa.create_annotation_classes_from_classes_json(self.PROJECT_NAME, self.classes_path)
Expand Down