File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
src/superannotate/lib/core/usecases Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -774,6 +774,18 @@ def validate_item_names(self):
774774
775775 self ._item_names = [item .name for item in self ._images .get_all (condition )]
776776
777+ def _prettify_annotations (self , annotations : List [dict ]):
778+ restruct = {}
779+
780+ if self ._item_names_provided :
781+ for annotation in annotations :
782+ restruct [annotation ["metadata" ]["name" ]] = annotation
783+ try :
784+ return [restruct [x ] for x in self ._item_names ]
785+ except KeyError :
786+ raise AppException ("Broken data." )
787+
788+ return annotations
777789
778790 async def get_big_annotation (
779791 self ,
@@ -858,7 +870,7 @@ def execute(self):
858870 self .reporter .log_warning (
859871 f"Could not find annotations for { items_count - received_items_count } /{ items_count } items."
860872 )
861- self ._response .data = annotations
873+ self ._response .data = self . _prettify_annotations ( annotations )
862874 return self ._response
863875
864876
You can’t perform that action at this time.
0 commit comments