@@ -257,8 +257,6 @@ def attach_image_urls_to_project(*args, **kwargs):
257257 {
258258 "project_name" :
259259 get_project_name (project ),
260- "Image Names" :
261- bool (args [1 :2 ] or kwargs .get ("attachments" , None )),
262260 "Annotation Status" :
263261 bool (args [2 :3 ] or kwargs .get ("annotation_status" , None ))
264262 }
@@ -918,12 +916,13 @@ def consensus(*args, **kwargs):
918916 folder_names = args [1 ]
919917 image_list = kwargs .get ("image_list" , "empty" )
920918 if image_list == "empty" :
921- image_list = args [3 :4 ]
922- if len (image_list ) and image_list [0 ] == None :
923- from superannotate .db .images import search_images as sa_search_images
924- image_list = sa_search_images (project )
925- else :
926- image_list = image_list [0 ]
919+ image_list = args [4 :5 ]
920+ if image_list :
921+ if image_list [0 ] == None :
922+ from superannotate .db .images import search_images as sa_search_images
923+ image_list = sa_search_images (project )
924+ else :
925+ image_list = image_list [0 ]
927926 annot_type = kwargs .get ("annot_type" , "empty" )
928927 if annot_type == 'empty' :
929928 annot_type = args [4 :5 ]
@@ -961,11 +960,12 @@ def benchmark(*args, **kwargs):
961960 image_list = kwargs .get ("image_list" , "empty" )
962961 if image_list == "empty" :
963962 image_list = args [4 :5 ]
964- if len (image_list ) and image_list [0 ] == None :
965- from superannotate .db .images import search_images as sa_search_images
966- image_list = sa_search_images (project )
967- else :
968- image_list = image_list [0 ]
963+ if image_list :
964+ if image_list [0 ] == None :
965+ from superannotate .db .images import search_images as sa_search_images
966+ image_list = sa_search_images (project )
967+ else :
968+ image_list = image_list [0 ]
969969 annot_type = kwargs .get ("annot_type" , "empty" )
970970 if annot_type == 'empty' :
971971 annot_type = args [5 :6 ]
@@ -1610,12 +1610,15 @@ def aggregate_annotations_as_df(*args, **kwargs):
16101610 folder_names = kwargs .get ("folder_names" , "empty" )
16111611 if folder_names == "empty" :
16121612 folder_names = args [5 :6 ]
1613- if folder_names != None :
1614- folder_names = len (folder_names )
1613+ if folder_names :
1614+ folder_names = folder_names [0 ]
1615+ if folder_names == None :
1616+ folder_names = []
1617+
16151618 return {
16161619 "event_name" : "aggregate_annotations_as_df" ,
16171620 "properties" : {
1618- "Folder Count" : folder_names ,
1621+ "Folder Count" : len ( folder_names ) ,
16191622 }
16201623 }
16211624
0 commit comments