File tree Expand file tree Collapse file tree 2 files changed +16
-9
lines changed
src/superannotate/lib/core Expand file tree Collapse file tree 2 files changed +16
-9
lines changed Original file line number Diff line number Diff line change 11from typing import List
22from typing import Optional
33from typing import Union
4+ from typing import Dict
45
56from pydantic import BaseModel
67from pydantic import constr
@@ -46,15 +47,20 @@ class Metadata(BaseModel):
4647 height : Optional [int ]
4748
4849
50+ class PointLabels (BaseModel ):
51+ __root__ : Dict [constr (regex = r"^[0-9]*$" ), str ]
52+
53+
4954class BaseInstance (BaseModel ):
5055 type : AnnotationType
5156 classId : int
5257 groupId : Optional [int ]
5358 attributes : List [Attribute ]
59+ point_labels : Optional [PointLabels ]
5460
5561 class Config :
5662 error_msg_templates = {
57- "value_error.missing" : "ield required for annotation" ,
63+ "value_error.missing" : "field required for annotation" ,
5864 }
5965
6066
Original file line number Diff line number Diff 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"
You can’t perform that action at this time.
0 commit comments