Skip to content

Commit a731b32

Browse files
committed
Fix json validation
1 parent de1247e commit a731b32

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/superannotate/lib/core/usecases/annotations.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -370,15 +370,16 @@ def is_valid_json(
370370

371371
def execute(self):
372372
if self.is_valid():
373-
bucket = self.s3_bucket
374-
annotation_json = self.prepare_annotations(
375-
project_type=self._project.project_type,
376-
annotations=self.get_annotation_json(),
377-
annotation_classes=self._annotation_classes,
378-
templates=self._templates,
379-
reporter=self.reporter,
380-
)
373+
annotation_json = self.get_annotation_json()
381374
if self.is_valid_json(annotation_json):
375+
bucket = self.s3_bucket
376+
annotation_json = self.prepare_annotations(
377+
project_type=self._project.project_type,
378+
annotations=annotation_json,
379+
annotation_classes=self._annotation_classes,
380+
templates=self._templates,
381+
reporter=self.reporter,
382+
)
382383
bucket.put_object(
383384
Key=self.annotation_upload_data.images[self._image.uuid][
384385
"annotation_json_path"

0 commit comments

Comments
 (0)