@@ -3230,7 +3230,7 @@ def execute(self):
32303230 if self ._include_annotations :
32313231 annotations = self .download_annotation_use_case .execute ().data
32323232
3233- if self ._include_annotations and self ._include_fuse :
3233+ if self ._include_annotations and ( self ._include_fuse or self . _include_overlay ) :
32343234 classes = self .get_annotation_classes_ues_case .execute ().data
32353235 fuse_image = (
32363236 CreateFuseImageUseCase (
@@ -3279,9 +3279,6 @@ def __init__(
32793279 self ._mask = mask
32803280 self ._verbose = verbose
32813281 self ._annotation_path = annotation_path
3282- self .unknown_classes = []
3283- self .unknown_attribute_groups = []
3284- self .unknown_attributes = []
32853282
32863283 def validate_project_type (self ):
32873284 if self ._project .project_type in constances .LIMITED_FUNCTIONS :
@@ -3384,7 +3381,6 @@ def fill_classes_data(self, annotations: dict):
33843381 annotation_class_name = annotation ["className" ]
33853382 if annotation_class_name not in annotation_classes .keys ():
33863383 if annotation_class_name not in unknown_classes :
3387- self .unknown_classes .append (annotation_class_name )
33883384 unknown_classes [annotation_class_name ] = {
33893385 "id" : - (len (unknown_classes ) + 1 ),
33903386 "attribute_groups" : {},
@@ -3402,14 +3398,15 @@ def fill_classes_data(self, annotations: dict):
34023398 for annotation in [i for i in annotations ["instances" ] if "className" in i ]:
34033399 annotation_class_name = annotation ["className" ]
34043400 if annotation_class_name not in annotation_classes .keys ():
3401+ logger .warning (f"Couldn't find annotation class { annotation_class_name } " )
34053402 continue
34063403 annotation ["classId" ] = annotation_classes [annotation_class_name ]["id" ]
34073404 for attribute in annotation ["attributes" ]:
34083405 if (
34093406 attribute ["groupName" ]
34103407 not in annotation_classes [annotation_class_name ]["attribute_groups" ]
34113408 ):
3412- self . unknown_attribute_groups . append ( attribute [" groupName" ] )
3409+ logger . warning ( f"Couldn't find annotation group { attribute [' groupName' ] } ." )
34133410 continue
34143411 attribute ["groupId" ] = annotation_classes [annotation_class_name ][
34153412 "attribute_groups"
@@ -3421,22 +3418,15 @@ def fill_classes_data(self, annotations: dict):
34213418 ][attribute ["groupName" ]]["attributes" ]
34223419 ):
34233420 del attribute ["groupId" ]
3424- self .unknown_attributes .append (attribute ["name" ])
3421+ logger .warning (
3422+ f"Couldn't find annotation name { attribute ['name' ]} in"
3423+ f" annotation group { attribute ['groupName' ]} " ,
3424+ )
34253425 continue
34263426 attribute ["id" ] = annotation_classes [annotation_class_name ][
34273427 "attribute_groups"
34283428 ][attribute ["groupName" ]]["attributes" ][attribute ["name" ]]
34293429
3430- def report_unknown_data (self ):
3431- if self .unknown_classes :
3432- logger .warning (f"Unknown classes [{ ', ' .join (self .unknown_classes )} ]" )
3433- if self .unknown_attribute_groups :
3434- logger .warning (
3435- f"Unknown attribute_groups [{ ', ' .join (self .unknown_attribute_groups )} ]"
3436- )
3437- if self .unknown_attributes :
3438- logger .warning (f"Unknown attributes [{ ', ' .join (self .unknown_attributes )} ]" )
3439-
34403430 def execute (self ):
34413431 if self .is_valid ():
34423432 image_data = self ._backend_service .get_bulk_images (
@@ -3464,8 +3454,6 @@ def execute(self):
34643454 resource = session .resource ("s3" )
34653455 bucket = resource .Bucket (response .data .bucket )
34663456 self .fill_classes_data (self ._annotations )
3467- # skipped report
3468- # self.report_unknown_data()
34693457 bucket .put_object (
34703458 Key = response .data .images [image_data ["id" ]]["annotation_json_path" ],
34713459 Body = json .dumps (self ._annotations ),
0 commit comments